We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89fd281 commit 46af4cdCopy full SHA for 46af4cd
autoload/lsp/ui/vim/folding.vim
@@ -178,10 +178,15 @@ function! s:handle_fold_request(server, data) abort
178
endif
179
let s:folding_ranges[a:server][l:bufnr] = l:result
180
181
+ " Don't do the 'windo' in Insert mode, it puts Vim back in Normal mode.
182
+ if mode()[0] ==# 'i'
183
+ return
184
+ endif
185
+
186
" Set 'foldmethod' back to 'expr', which forces a re-evaluation of
187
" 'foldexpr'. Only do this if the user hasn't changed 'foldmethod',
188
" and this is the correct buffer.
- let l:current_window = bufwinnr()
189
+ let l:current_window = winnr()
190
windo if &l:foldmethod ==# 'expr' && bufnr('%') == l:bufnr | let &l:foldmethod = 'expr' | endif
191
execute l:current_window . 'wincmd w'
192
endfunction
0 commit comments