vim-import-js icon indicating copy to clipboard operation
vim-import-js copied to clipboard

Prompt can have bad interactions with some other plugins, like Ale

Open lencioni opened this issue 8 years ago • 4 comments

I am using Ale for async linting, which can update Vim in a way that messes up import JS when presented with the list of unresolved imports. This leaves Vim in a confusing state. Here's a demonstration:

import-js-ale

I imagine there are other plugins that might have similar interactions.

I wonder if we could fix this by using a nicer prompt. It would be great to use a command-t style prompt where one option is highlighted and I can press enter to select it and use arrow keys to move up and down the list. This would pave the way to add fuzzy text filtering as well, which could be helpful when presented with a lot of options.

lencioni avatar Jun 22 '17 14:06 lencioni

@w0rp I'm wondering if you have any thoughts on how to handle this. It seems that if I have an inputlist() active and then Ale comes back and updates the buffer with errors/warnings, the inputlist becomes unreadable. I tried setting let g:ale_sign_column_always = 1 to determine if it was because the gutter appeared, but that didn't resolve this.

lencioni avatar Jun 24 '17 17:06 lencioni

I'll file a bug for it.

w0rp avatar Jun 25 '17 10:06 w0rp

I was looking into this, and it looks like the inputlist rendering can mess up when any timer function ticks at all. You can try the following:

function Foo(...)
endfunction

call timer_start(2000, function('Foo'))
call inputlist([])

The cursor inside of the inputlist will move, possibly other things will go wrong. You can use call timer_stopall() if that function exists, but the results could be unpredictable.

I'll file this as a bug in Vim. I don't see any reason why even 'echo' should mess with inputlist.

w0rp avatar Jul 15 '17 20:07 w0rp

https://github.com/vim/vim/issues/1843 I filed a bug in Vim here.

w0rp avatar Jul 15 '17 20:07 w0rp