Comments (9)
Please test if 5669f48 fixes the problem. It also tries to fix other issues (for example :Rg !
from fzf.vim results in searching for ^!
).
from fzf.
It seems like it fixed it in a quick test I did
from fzf.
Thank you. I don't know if you have already done it, but can you also update the binary and see how it works with the latest Vim plugin? I'm attaching the one I just built on my machine from the latest source.
from fzf.
I did another round of test with the binary you attached
❯ fzf --version
0.51.0-devel (c5fb0c4)
Looks good. I didn't have any escape issue.
from fzf.
Thanks a lot! Will release a new version with the fix soon.
from fzf.
I logged the resulted strings to compare
Escaped options now:
"--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"
"-m"
"--prompt"
"C:/Users/daniel/.usr_conf\\"
"--preview"
"C:\Windows\System32\bash.exe /mnt/c/Users/daniel/.cache/vimfiles/.cache/init.vim/.dein/bin/preview.sh {}"
"--bind"
"0:toggle-preview"
"--layout=reverse"
"--preview"
"bat -pp --color=always --style=numbers {}"
"--multi"
"--ansi"
"--info=inline"
"--bind"
"alt-c:clear-query"
"--bind"
"ctrl-l:change-preview-window^(down^|hidden^|^),ctrl-/:change-preview-window^(down^|hidden^|^),alt-up:preview-page-up,alt-down:preview-page-down"
"--bind"
"ctrl-s:toggle-sort"
"--cycle"
"--bind"
"alt-f:first"
"--bind"
"alt-l:last"
"--bind"
"alt-a:select-all"
"--bind"
"alt-d:deselect-all"
Escaped options pre-change:
^"--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^"
^"-m^"
^"--prompt^"
^"C:/Users/daniel/.usr_conf\\^"
^"--preview^"
^"C:\Windows\System32\bash.exe /mnt/c/Users/daniel/.cache/vimfiles/.cache/init.vim/.dein/bin/preview.sh {}^"
^"--bind^"
^"0:toggle-preview^"
^"--layout=reverse^"
^"--preview^"
^"bat -pp --color=always --style=numbers {}^"
^"--multi^"
^"--ansi^"
^"--info=inline^"
^"--bind^"
^"alt-c:clear-query^"
^"--bind^"
^"ctrl-l:change-preview-window^(down^|hidden^|^),ctrl-/:change-preview-window^(down^|hidden^|^),alt-up:preview-page-up,alt-down:preview-page-down^"
^"--bind^"
^"ctrl-s:toggle-sort^"
^"--cycle^"
^"--bind^"
^"alt-f:first^"
^"--bind^"
^"alt-l:last^"
^"--bind^"
^"alt-a:select-all^"
^"--bind^"
^"alt-d:deselect-all^"
I can see that the result is very similar but the quotes are not escaped now.
from fzf.
Does this patch fix the issue?
from fzf.
I was about to comment. This fixed the issue
@@ -86,7 +86,7 @@ endif
let s:cmd_control_chars = ['&', '|', '<', '>', '(', ')', '@', '^', '!']
function! s:shellesc_cmd(arg)
- let e = '"'
+ let e = '^"'
let slashes = 0
for c in split(a:arg, '\zs')
if c ==# '\'
@@ -103,7 +103,8 @@ function! s:shellesc_cmd(arg)
endif
let e .= c
endfor
- let e .= repeat('\', slashes) .'"'
+ let e .= repeat('\', slashes) .'^"'
return e
endfunction
but I'm unsure if getting rid of the escape on the quotes is the intention
from fzf.
I've done some further testing and it is working fine. A custom command broke with the changes but I was able to simplify the escaping so I'd say it is an improvement.
Before:
let fzf_rg_args = ' --glob=^"^!.git^" --glob=^"^!node_modules^" --column --line-number --no-ignore --no-heading --color=always --smart-case --hidden '
After:
let fzf_rg_args = ' --glob="!.git" --glob="!node_modules" --column --line-number --no-ignore --no-heading --color=always --smart-case --hidden '
I also checked Rg !
and it indeed searched for the exclamation mark symbol !
.
Let me know if you'd like me to review something else. If not, feel free to close the issue.
from fzf.
Related Issues (20)
- Background color for prompt only? HOT 4
- Tarball extraction in install.sh — improvement suggestion HOT 6
- Calling fzf#run with a list as source fail (n)vim is used from git bash HOT 25
- FZF_COMPLETION_OPTS to not follow symbolic link on **<TAB> completion being ignored HOT 5
- Preserve fzf fuzzy list view? HOT 11
- Preserve color output of `kubecolor get pods -A | fzf --ansi`? HOT 1
- Is it possible to create new bind on action from transform HOT 2
- Unknown command fzf_key_bindings error when invoking read in a Fish shell script HOT 3
- Header line at bottom? HOT 1
- `{q}` isn't escaped properly on Windows HOT 12
- last good fzf for fzf.vim on Windows 10 HOT 4
- FZF ignores nested files from $FZF_DEFAULT_COMMAND='fd' but not when piping fd into FZF HOT 3
- Can't input non ascii characters HOT 6
- Hang on SIGSTP when session leader
- simplify cygwin handling in Git Bash
- Action to clear selections if there are any else exit fzf. (Feature request) HOT 1
- Feature request: no-clear option that affects execute action (no clear before executing)
- On fzf.vim opening in new cmd Window in Git Bash HOT 37
- [Feature Request] Combining `--expect` and `--bind` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fzf.