junegunn / fzf.vim

fzf :heart: vim
MIT License
9.51k stars 581 forks source link

[bug] :Commands command do not fuzzy find in windows #1542

Closed DanSM-5 closed 1 month ago

DanSM-5 commented 1 month ago

I found that the :Commands (fzf#vim#commands()) command do not fuzzy find under windows. I made some tests and I found it is related to the -d (delimiter flag) that is being added.

I can reproduce the behavior directly in the command line with the the generated command by fzf#vim#commands:

type C:\Users\daniel\tmp\test-commands.txt | fzf --border  --border "--color=bg+:237,bg:235,spinner:214,hl:214,fg:223,header:241,info:109,pointer:109,marker:208,fg+:223,prompt:246,hl+:214" --ansi --expect ctrl-x --tiebreak=index --header-lines 1 -x --prompt "Commands> " --nth="2,3,2..3" -d  --no-height

File source used for test: test-commands.txt

In powershell: https://github.com/junegunn/fzf.vim/assets/49035812/12f28813-8dd6-415e-842c-4dcfc660a63e

In WSL: https://github.com/junegunn/fzf.vim/assets/49035812/d039dfec-a203-4763-a7bc-0144b303ae12

NOTE: I wasn't sure if fill this issue here as a bug in the fzf.vim plugin in case windows should not use that flag or should have a specific value or in fzf repo as a bug for windows with -d flag as I haven't used that option before. I understand is to set a delimiter but none was being used in either windows or linux (wsl). Let me know and I'll move the issue appropriately.

fzf --version
0.51.0-devel (c5fb0c4)
junegunn commented 1 month ago

It should work now.

junegunn commented 1 month ago

The problem was the non-breaking space character which we used as a delimiter (-d NBS) was not properly passed to the Windows command. I was able to fix it by replacing the use of it with tab and with --tabstop=1.