Skip to content

Commit 7c7a37a

Browse files
committed
fix: trigger fold recomputation by querying foldlevel
Problem: * Redrawing may break some plugins. For example, evaluating statusline may use to buffer variables that are initialized in some autocommands. But FastFold's autocmds may run before than them. So redrawing may result in using some undefined variable. * Redrawing makes the screen flash. Solution: Querying foldlevel seems to be sufficient for triggerring fold recomputation.
1 parent 3a1e5ed commit 7c7a37a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

plugin/fastfold.vim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,9 @@ endfunction
7272
if exists('*win_execute')
7373
function! s:WinDo( command )
7474
for w in range(1, winnr('$'))
75-
call win_execute(win_getid(w), a:command, 1)
75+
" query foldlevel to trigger recomputation of folds
76+
call win_execute(win_getid(w), a:command . ' | call foldlevel(1)', 1)
7677
endfor
77-
" trigger recomputation of fold
78-
redraw
7978
endfunction
8079
else
8180
" See http://vim.wikia.com/wiki/Run_a_command_in_multiple_buffers#Restoring_position

0 commit comments

Comments
 (0)