This fixes an issue i had trying to integrate lsp-status.nvim into my statusline. Everytime i moved my cursor all my folds were getting closed. I found out that doautocmd reloads the modeline which caused foldlevel=0 from my modeline to be run again. Fortunately this can be suppressed using the <nomodeline> flag. I replaced every doautocmd call with doautocmd <nomodeline>.
Example
Use the following file and command to reproduce: nvim --clean -u test.vim test.vim
" Test {{{
set modeline
au User Test echom 'test'
" }}}
" vim: foldmethod=marker foldenable foldlevel=0
This fixes an issue i had trying to integrate lsp-status.nvim into my statusline. Everytime i moved my cursor all my folds were getting closed. I found out that
doautocmd
reloads themodeline
which causedfoldlevel=0
from my modeline to be run again. Fortunately this can be suppressed using the<nomodeline>
flag. I replaced everydoautocmd
call withdoautocmd <nomodeline>
.Example
Use the following file and command to reproduce:
nvim --clean -u test.vim test.vim