Closed xuxinx closed 5 years ago
remove let g:syntastic_auto_loc_list = 1
works
"Doctor, it hurts when I do X!"
Back when the relevant part of syntastic core was written Vim plugins had no way to tell whether a given window was associated to a loclist, and if it did, what buffer was its owner. A plugin could navigate back and forth through the loclist stack, but it couldn't tell whether the stack has changed when it wasn't looking, or what was the current pointer in said stack. And so on. For this reason syntastic had to invent workarounds for all sorts of limitations, and of course the workarounds only worked in (optimistically) maybe 95% of cases. Another consequence was that in order to do internal bookkeeping syntastic had to invent wrappers around standard Vim commands. F.i. to open the error window you were supposed to run :Errors
, not :lopen
, and then you were supposed to refrain from messing with the loclist stack. If you run :lopen
when the error window is already open you'll override syntastic's idea of state with something else.
Now, in more recent times Vim added features that lifted many (not all) of the limitations relevant to syntastic. However I haven't kept up with Vim development for quite a while now, so syntastic is still using the old workarounds, even though much better solutions are now possible. Patches are welcome. Or you could switch to ALE, which offers a more modern approach, and is actively maintained.
Got it. Thanks!
steps to reproduce the bug
filetype off set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim' Plugin 'vim-syntastic/syntastic' call vundle#end() filetype plugin indent on
let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_wq = 1 let g:syntastic_sh_checkers = ['shellcheck']
vim -u .test_vimrc test.sh
:w
:lopen
:lclose
Error
the version of Vim
also tried version
8.1.1800
the version of syntastic