-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use g:cursorhold_updatetime instead of &updatetime
Decoupling updatetime from CursorHold allows to have a short cursorhold updatetime without writing the swap on the disk too often. See :h updatetime
- Loading branch information
1 parent
ec2d3f4
commit 1097c90
Showing
2 changed files
with
19 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
" Maintainer: Antoine Madec <[email protected]> | ||
|
||
if exists('g:loaded_fix_cursorhold_nvim') || !has('nvim') | ||
if exists('g:loaded_fix_cursorhold_nvim') | ||
finish | ||
else | ||
let g:loaded_fix_cursorhold_nvim = 'yes' | ||
|
@@ -31,5 +31,6 @@ function s:CursorHoldTimer(mode) abort | |
call timer_stop(g:fix_cursorhold_nvim_timer) | ||
endif | ||
let cb = a:mode == "n" ? 's:CursorHold_Cb' : 's:CursorHoldI_Cb' | ||
let g:fix_cursorhold_nvim_timer = timer_start(&updatetime, function(cb)) | ||
let t = get(g:, 'cursorhold_updatetime', &updatetime) | ||
let g:fix_cursorhold_nvim_timer = timer_start(t, function(cb)) | ||
endfunction |