Giter Club home page Giter Club logo

Comments (9)

junegunn avatar junegunn commented on May 27, 2024 1

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.

DanSM-5 avatar DanSM-5 commented on May 27, 2024 1

It seems like it fixed it in a quick test I did

from fzf.

junegunn avatar junegunn commented on May 27, 2024 1

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.

fzf.exe.zip

from fzf.

DanSM-5 avatar DanSM-5 commented on May 27, 2024 1

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.

junegunn avatar junegunn commented on May 27, 2024 1

Thanks a lot! Will release a new version with the fix soon.

from fzf.

DanSM-5 avatar DanSM-5 commented on May 27, 2024

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.

junegunn avatar junegunn commented on May 27, 2024

Does this patch fix the issue?

5669f48

from fzf.

DanSM-5 avatar DanSM-5 commented on May 27, 2024

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.

DanSM-5 avatar DanSM-5 commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.