File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -178,15 +178,13 @@ function! s:handle_fold_request(server, data) abort
178
178
endif
179
179
let s: folding_ranges [a: server ][l: bufnr ] = l: result
180
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
181
" Set 'foldmethod' back to 'expr', which forces a re-evaluation of
187
182
" 'foldexpr'. Only do this if the user hasn't changed 'foldmethod',
188
183
" and this is the correct buffer.
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'
184
+ for l: winid in win_findbuf (l: bufnr )
185
+ if getwinvar (l: winid , ' &foldmethod' ) == # ' expr'
186
+ call setwinvar (l: winid , ' &foldmethod' , ' expr' )
187
+ endif
188
+ endfor
192
189
endfunction
190
+
You can’t perform that action at this time.
0 commit comments