junegunn / fzf.vim

fzf :heart: vim
MIT License
9.62k stars 584 forks source link

[windows] calling fzf#vim#with_preview before fzf#vim#gitfiles causes backspace and mouse scroll stop working #1570

Open DanSM-5 opened 1 week ago

DanSM-5 commented 1 week ago

Checklist

Output of :echo system(fzf#exec() .. ' --version')

0.55.0 (fc69308)

OS

Problem / Steps to reproduce

Issue

Calling fzf#vim#with_preview in vim before calling fzf#vim#gitfiles('?', ...) (git status) from git bash shell causes mouse scroll to stop working (it always moves to the center) and backspace stops working (do not delete text) and in some cases it starts inserting spaces.

The most problematic part is that it doesn't seem to be a way to exit that state.

I tried to record the issue. Notice the keys being presses on the bottom left corner.

https://github.com/user-attachments/assets/657b8749-db5d-4dac-be87-367e8ea4fc7f

Curiously though, if you call fzf#vim#gitfiles('?', ...) first, an error will appear on screen but the function will succeed. After that it doesn't matter if you use fzf#vim#with_preview, it won't enter on the weird state.

https://github.com/user-attachments/assets/cf50e35f-55b8-4fe8-8d00-b3d6b5ce6dbd

Remarks

" neovim
:echo fzf#vim#with_preview({ 'options': [] }, 0)
" {'options': ['--preview', 'C:\PROGRA~1\Git\usr\bin\bash.exe C:/Users/daniel/AppData/Local/nvim-data/plugged/fzf.vim/bin/preview.sh {}', '--bind', '0:toggle-preview']}

" vim
:echo fzf#vim#with_preview({ 'options': [] }, 0)
" { 'options': [] }

Additional information