Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Display offset for filenames with spaces #551

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

guillaumeboehm
Copy link
Contributor

Reopening #548 in different issue.

@PThorpe92
Copy link
Member

PThorpe92 commented Oct 20, 2023

I think if you delete that #[rustfmt::skip] that was in the middle of that function. and run rustfmt, it might fix the build. that's what I was trying to do when i accidentally closed ur last PR.

(that was obviously already there.. not your fault, I was just trying to clean it up and it so happened to be on your fork because you're touching this part of the code)

@guillaumeboehm
Copy link
Contributor Author

guillaumeboehm commented Oct 20, 2023

I don't really understand what the checks are supposed to check ? Is there a way for me to check on my machine directly without having to push to launch a job ?

EDIT: Oh I'm actually just stupid I didn't realize rustfmt was a command... Testing that

@guillaumeboehm
Copy link
Contributor Author

So much for me trying to format the code nicely myself xD

@PThorpe92
Copy link
Member

After further review I believe we also need to check for

if file.name.contains(' ') || file.name.contains('\'') { 2 } else { 0 }

as a file name with a quote in it will cause it to be quoted as well. This is found in the check in src/options/escape.rs

    let needs_quotes = string.contains(' ') || string.contains('\'');

After that LGTM 👍

PThorpe92
PThorpe92 previously approved these changes Oct 21, 2023
@guillaumeboehm
Copy link
Contributor Author

Also fixes #515 I believe

Copy link
Member

@cafkafk cafkafk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cargo run -- --blocksize -l --hyperlink --grid --git-repos -x --time-style "+%Y, %Y, %d%d%d - %a %u" --git --header --icons -Z -@ -o
2023-10-22_16-16

This bugfix targets this bug right? It's still present as far as I can tell

@cafkafk
Copy link
Member

cafkafk commented Oct 22, 2023

sorry I can't be of more help with this currently I'm a bit busy irl

@guillaumeboehm
Copy link
Contributor Author

I didn't realize there was a different code for detailed outputs, it should be good now if I didn't mess up the formatting yet again.

@PThorpe92
Copy link
Member

PThorpe92 commented Oct 22, 2023

sorry I can't be of more help with this currently I'm a bit busy irl

No worries at all ❤️

cargo run -- --blocksize -l --hyperlink --grid --git-repos -x --time-style "+%Y, %Y, %d%d%d - %a %u" --git --header --icons -Z -@ -o 2023-10-22_16-16

This bugfix targets this bug right? It's still present as far as I can tell

Wow I can't believe I didn't see that and frankly I'm surprised even the tests didn't catch that one..

Ok tested locally this looks good. Can I get another @eza-community/eza-commiters review on this?

Copy link
Member

@PThorpe92 PThorpe92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks 👍

@ariasuni
Copy link
Contributor

Wow I can't believe I didn't see that and frankly I'm surprised even the tests didn't catch that one..

Yeah we should probably add a test for that

@PThorpe92
Copy link
Member

Yeah we should probably add a test for that

Indeed. The current tests all have filenames without spaces or quotes, and none of them are longer than a few characters. Definitely not ideal

Copy link
Member

@cafkafk cafkafk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to fix it, and integration tests pass, LGTM thanks for fixing this

@cafkafk cafkafk merged commit bba97b5 into eza-community:main Oct 24, 2023
14 checks passed
@aarondill
Copy link

@cafkafk @guillaumeboehm this only fixes the issue when quotes are being displayed. After this patch, using --no-quotes now results in files being offset to the left:
2023-10-26_07-36

@guillaumeboehm
Copy link
Contributor Author

@cafkafk @guillaumeboehm this only fixes the issue when quotes are being displayed. After this patch, using --no-quotes now results in files being offset to the left:
2023-10-26_07-36

Oh I didn't see that option... I'll fix this when I get home.

@PThorpe92
Copy link
Member

I got a PR ready unless you'd like to submit one @guillaumeboehm

@guillaumeboehm
Copy link
Contributor Author

I got a PR ready unless you'd like to submit one @guillaumeboehm

No it's all good if you have one ! Thanks ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

5 participants