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

Remove problematic character from __fzf_search_current_dir #142

Merged
merged 2 commits into from
Mar 24, 2021
Merged

Remove problematic character from __fzf_search_current_dir #142

merged 2 commits into from
Mar 24, 2021

Conversation

fezboy
Copy link
Contributor

@fezboy fezboy commented Mar 23, 2021

There was an zero-width space hiding before a comment throwing an error. (the character's invisible in a browser or terminal, but running git diff (this commit's hash) 2c0fb5 | vim - should make it visible)

@PatrickF1
Copy link
Owner

PatrickF1 commented Mar 23, 2021

Hi, thanks for the PR! Wow so interesting! What is the error exactly and when does it trigger? When you run search directory? Or when you open up the file?
Btw git diff dcf533 2c0fb5 | vim - doesn't work for me because I don't have dcf533 anywhere.

cc: @kidonng how do you think it got added?

@PatrickF1
Copy link
Owner

Ah I see it now
Screen Shot 2021-03-23 at 3 28 08 PM

@PatrickF1 PatrickF1 changed the title Remove stray <200b> from __fzf_search_current_dir.fish Remove problematic invisible character from __fzf_search_current_dir Mar 23, 2021
@PatrickF1 PatrickF1 changed the title Remove problematic invisible character from __fzf_search_current_dir Remove problematic character from __fzf_search_current_dir Mar 23, 2021
@kidonng
Copy link
Contributor

kidonng commented Mar 24, 2021

😅 Mea culpa, this is accidentally introduced in 78c43a7 (#133), where I just copy and pasted the comment from an old commit on the web interface. I have no idea why they are added.

image

The problem here is there are actually two of them, and I only removed the latter one that broke the tests. I guess new versions of Fish can handle this so tests doesn't fail because of the former one (and it doesn't seem to cause error on my machine too, which is on Fish 3.2.1).

@PatrickF1
Copy link
Owner

Is that screenshot from the web interface? I've never seen those 2 dots before. I'm guessing they are used by the GitHub JS to start and end highlighting.

@kidonng
Copy link
Contributor

kidonng commented Mar 24, 2021

Not, it's that problematic line pasted in Chrome Devtools, which shows invisible characters. This is just for demonstration purpose.

@PatrickF1 PatrickF1 merged commit 3a46f14 into PatrickF1:main Mar 24, 2021
@PatrickF1
Copy link
Owner

Thanks that makes sense! I would still love to learn what errors it was causing tho...was it fish throwing up? I looked at the CI job that broke and the main thing that broke was formatting.

@kidonng
Copy link
Contributor

kidonng commented Mar 24, 2021

Maybe use a older version of Fish or ask the devs, as I don't encounter any issue.

@fezboy
Copy link
Contributor Author

fezboy commented Mar 24, 2021

I would still love to learn what errors it was causing tho...was it fish throwing up? I looked at the CI job that broke and the main thing that broke was formatting.

Here's the error: (Fish version 3.1.2)

⫸  fish: Unknown command: which may include tilde, variables, etc.
in command substitution
	called on line 9 of file ~/.config/fish/functions/__fzf_search_current_dir.fish
in function '__fzf_search_current_dir'
~/.config/fish/functions/__fzf_search_current_dir.fish: Unknown error while evaluating command substitution
in function '__fzf_search_current_dir'

(I'm pretty sure that it broke comment detection, but i'm not positive)
It comes up when I press "ctrl+f" I'm not sure what command that is, it was just the first thing that the README suggested doing after installing.

Edit: also, the rest of the spaces in that line are NBSPs, not standard ascii spaces. It probably won't break anything, but I'd recommend to be more careful with your copypasta in the future

Output of $ bat --show-all __fzf_search_current_dir.fish

       │ File: __fzf_search_current_dir.fish
───────┼───────────────────────────────────────────────────────────────────
   1   │ function·__fzf_search_current_dir·--description·"Search·the·curren
       │ t·directory.·Replace·the·current·token·with·the·selected·file·path
       │ s."␊
   2   │ ····#·Make·sure·that·fzf·uses·fish·to·execute·__fzf_preview_file.␊
   ·   |
   ·   |
   ·   |
   9   │ ····#·expand\u{a0}the\u{a0}token\u{a0}(which\u{a0}may\u{a0}include
       │ \u{a0}tilde,\u{a0}variables,\u{a0}etc.)\u{a0}into\u{a0}full\u{a0}p
       │ ath␊

(\u{a0} being unicode character U+00A0, the Non-breaking space)

@PatrickF1
Copy link
Owner

Thanks! Gonna release a hotfix for this.

hrshtst pushed a commit to hrshtst/fzf.fish that referenced this pull request Apr 26, 2021
There was a zero-width character that came from copy and pasting code from the GitHub web interface. It's invisible but can be seen by running git diff 2c0fb53 2c0fb53^ | vim -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants