Skip to content

Commit 732bb05

Browse files
committed
Related to #61 - Automatically unpause FadeActive/UnfadeActive functions
1 parent 7a72524 commit 732bb05

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

autoload/vimade.vim

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,18 +707,28 @@ function! vimade#Tick(num)
707707
endtry
708708
endfunction
709709

710+
function! vimade#BypassPause(fn)
711+
if g:vimade_paused
712+
call vimade#Unpause()
713+
call a:fn()
714+
call vimade#Pause()
715+
else
716+
call a:fn()
717+
endif
718+
endfunction
719+
710720
function! vimade#FadeActive()
711721
"immediately fade current buffer
712722
"deferred shouldn't be used here due to usage of pause in tmux flow
713723
let g:vimade_fade_active=1
714-
call vimade#CheckWindows()
724+
call vimade#BypassPause(function('vimade#CheckWindows'))
715725
endfunction
716726

717727
function! vimade#UnfadeActive()
718728
"immediately unfade current buffer
719729
"deferred shouldn't be used here due to usage of pause in tmux flow
720730
let g:vimade_fade_active=0
721-
call vimade#CheckWindows()
731+
call vimade#BypassPause(function('vimade#CheckWindows'))
722732
endfunction
723733

724734
function! vimade#GetNvimHi(id)

0 commit comments

Comments
 (0)