nvim-lua / lsp-status.nvim

Utility functions for getting diagnostic status and progress messages from LSP servers, for use in the Neovim statusline
MIT License
625 stars 41 forks source link

Fix problem with doautocmd and modeline #32

Closed nlueb closed 3 years ago

nlueb commented 3 years ago

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

Peek 2020-12-21 12-50