Skip to content

Commit

Permalink
Prefer method-chain-like style
Browse files Browse the repository at this point in the history
  • Loading branch information
machakann committed Sep 27, 2018
1 parent 26aea0c commit 4ffeda6
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions autoload/highlightedyank.vim
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,20 @@ function! s:glow(region, hi_group, duration) abort "{{{
endif

let switchtask = s:Schedule.Task()
call switchtask.repeat(-1)
call switchtask.call(highlight.switch, [], highlight)
call switchtask.waitfor(['BufEnter'])
\.call(highlight.switch, [], highlight)
\.repeat(-1)
\.waitfor(['BufEnter'])

let s:quenchtask = s:Schedule.Task()
call s:quenchtask.call(highlight.quench, [], highlight)
call s:quenchtask.call(switchtask.cancel, [], switchtask)
call s:quenchtask.waitfor([a:duration,
\ ['TextChanged', '<buffer>'], ['InsertEnter', '<buffer>'],
\ ['BufUnload', '<buffer>'], ['CmdwinLeave', '<buffer>'],
\ ['TabLeave', '*']])
\.call(highlight.quench, [], highlight)
\.call(switchtask.cancel, [], switchtask)
\.repeat(1)
\.waitfor([a:duration,
\ ['TextChanged', '<buffer>'],
\ ['InsertEnter', '<buffer>'],
\ ['BufUnload', '<buffer>'],
\ ['CmdwinLeave', '<buffer>'],
\ ['TabLeave', '*']])
endfunction "}}}


Expand Down

0 comments on commit 4ffeda6

Please sign in to comment.