Unable to cancel PickBuffer() in a vim `:terminal` (NeoVim and Vim8)
To reproduce:
- Start
vimwith no open buffers. - Call
PickBuffer()and observe the pick interface empty as expected. - Try
Ctrl Cto exit. - Try
Ctrl Dto exit. - Observe neither works as expected.
I can't reproduce this with the latest pick.vim, the latest pick, on vim 7.4.944`.
Can you produce this with a minimal .vimrc? That only loads pick.vim?
Thanks for trying to reproduce @teoljungberg. It didn't occur to me to mention I'm using neovim. Apologies.
I cannot reproduce with latest pick.vim, pick, and vim 7.3.
With nvim 0.1.0-dev (edit: same with 0.1.0),
❯ nvim -u NONE -c 'source ~/.config/nvim/bundle/pick.vim/plugin/pick.vim' -c 'call PickBuffer()'
reproduces. This seems to be a problem with neovim (maybe how it handles async operations?), and not my configuration.
Would you agree? Any advice beyond filing an issue with neovim?
If memory serves me well, pick.vim doesn't work at all in neovim. I think it's due to how they've changed how ":!" and ":system()" works. @calleerlandsson knows more about that than I do.
Teo Ljungberg
On 4 dec. 2015, at 22:06, Jeffrey Horn [email protected] wrote:
Thanks for trying to reproduce @teoljungberg. It didn't occur to me to mention I'm using neovim. Apologies.
I cannot reproduce with latest pick.vim, pick, and vim 7.3.
With nvim 0.1.0-dev,
❯ nvim -u NONE -c 'source ~/.config/nvim/bundle/pick.vim/plugin/pick.vim' -c 'call PickBuffer()' reproduces. This seems to be a problem with neovim (maybe how it handles async operations?), and not my configuration.
Would you agree? Any advice beyond filing an issue with neovim?
— Reply to this email directly or view it on GitHub.
Hey @jrhorn424, thanks for reporting this!
Unfortunately, I'm not very familiar with neovim since I don't use it. Could you try the same thing using a program similar to pick? Some examples are selecta and fzf.
If we can fix this issue in pick, I'd be happy to do so.
I just tried selecta with michaelavila/selecta.vim in nvim 0.1.0-dev. It works as expected. I can use either ESC or RET to get out of the selecta window.
If I may hazard a guess, the difference in behavior might be due to the stated difference in goals for pick:
pick serves the same purpose as selecta but is faster and utilizes the alternate screen terminal feature to not leave choices on screen after the program finishes execution.
I'll try with fzf next, but I've been having trouble getting it installed and working in vim using pathogen.
When using fzf and fzf.vim with same nvim, calling Buffers to display an (empty) buffer list through fzf, I am able to exit as expected with either ESC or RET or Ctrl C.
Thanks for testing, @jrhorn424! It seems like the use of the alternate screen doesn't work in neovim.
When running pick inside of Vim, the use of the alternate screen is automatically disabled when the VIM environment variable is defined. Maybe neovim doesn't define this? Pick's use of the alternate screen can also be disabled explicitly using the -X option. Could you try that by adding the following to you vimrc?
let g:pick_executable = "pick -X"
If this works, could you paste any non-sensitive output of running :!env inside of neovim? Maybe there's an environment variable we could look for to detect running inside neovim?
nvim -u NONE -c 'source ~/.config/nvim/bundle/pick.vim/plugin/pick.vim' -c 'let g:pick_executable = "pick -X"' -c 'call PickBuffer()'
Still experiencing the issue. Here's some :!env:
SHELL=/usr/local/bin/zsh
TERM_PROGRAM=iTerm.app
TERM=xterm-256color
VIMRUNTIME=/usr/local/Cellar/neovim/0.1.0/share/nvim/runtime
NVIM_LISTEN_ADDRESS=/var/folders/1y/r5c46zcx2w17khhdnbd841l00000gn/T/nvim4rmRUo/0
Everything else seems unrelated (ruby, gcc options, etc etc).
For the hell of it, tried this:
export VIM=$(which nvim)
nvim -u NONE -c 'source ~/.config/nvim/bundle/pick.vim/plugin/pick.vim' -c 'let g:pick_executable = "pick -X"' -c 'call PickBuffer()'
No luck.
I'm sorry this isn't working properly.
Since I'm not a neovim user myself, I won't be able to maintain support for it. If anyone figures this out I'd be very happy to review your PRs both to pick.vim and pick.
I understand. Thanks for your help! 😄
I think this may have been related to: https://github.com/calleerlandsson/pick/pull/178
I can with a fresh install of nvim and the latest version of pick call pick.vim and open a file. There are a few odd behaviours (like the UI not updating all the time on navigating with the arrow-keys). But atleast its usable.
I tried this command with:
nvim -v: 0.1.7
pick -v: 1.5.3
nvim -u NONE -c 'source ~/.vim/bundle/pick.vim/plugin/pick.vim' -c 'let g:pick_executable = "pick -X"' -c 'call PickFile()'
This also does not work with the support of vim 8's :terminal support.