aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_autocmd.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-04-25 23:58:44 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-04-26 00:02:12 -0400
commited6c7fbf0bbabb93e01be14ebfa347c09a933be1 (patch)
tree751314e7cb02248f59fbfa18b965b818468d6603 /src/nvim/testdir/test_autocmd.vim
parent9d77a0768697aced470c72ba71d0e04cf45f0fd0 (diff)
downloadrneovim-ed6c7fbf0bbabb93e01be14ebfa347c09a933be1.tar.gz
rneovim-ed6c7fbf0bbabb93e01be14ebfa347c09a933be1.tar.bz2
rneovim-ed6c7fbf0bbabb93e01be14ebfa347c09a933be1.zip
vim-patch:8.1.0837: timer interrupting cursorhold and mapping not tested
Problem: Timer interrupting cursorhold and mapping not tested. Solution: Add tests with timers. (Ozaki Kiichi, closes vim/vim#3871) https://github.com/vim/vim/commit/26d982185e21398738a9c688429c0a1840d7c9c3
Diffstat (limited to 'src/nvim/testdir/test_autocmd.vim')
-rw-r--r--src/nvim/testdir/test_autocmd.vim27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index 6d4c54bbf9..d05ce292df 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -34,6 +34,28 @@ if has('timers')
call timer_start(LoadAdjust(100), 'ExitInsertMode')
call feedkeys('a', 'x!')
call assert_equal(1, g:triggered)
+ unlet g:triggered
+ au! CursorHoldI
+ set updatetime&
+ endfunc
+
+ func Test_cursorhold_insert_with_timer_interrupt()
+ if !has('job')
+ return
+ endif
+ " Need to move the cursor.
+ call feedkeys("ggG", "xt")
+
+ " Confirm the timer invoked in exit_cb of the job doesn't disturb
+ " CursorHoldI event.
+ let g:triggered = 0
+ au CursorHoldI * let g:triggered += 1
+ set updatetime=500
+ call job_start(has('win32') ? 'cmd /c echo:' : 'echo',
+ \ {'exit_cb': {j, s -> timer_start(1000, 'ExitInsertMode')}})
+ call feedkeys('a', 'x!')
+ call assert_equal(1, g:triggered)
+ unlet g:triggered
au! CursorHoldI
set updatetime&
endfunc
@@ -46,6 +68,7 @@ if has('timers')
" CursorHoldI does not trigger after CTRL-X
call feedkeys("a\<C-X>", 'x!')
call assert_equal(0, g:triggered)
+ unlet g:triggered
au! CursorHoldI
set updatetime&
endfunc
@@ -457,7 +480,7 @@ endfunc
func Test_OptionSet()
throw 'skipped: Nvim does not support test_override()'
- if !has("eval") || !has("autocmd") || !exists("+autochdir")
+ if !has("eval") || !exists("+autochdir")
return
endif
@@ -598,7 +621,7 @@ endfunc
func Test_OptionSet_diffmode()
throw 'skipped: Nvim does not support test_override()'
call test_override('starting', 1)
- " 18: Changing an option when enetering diff mode
+ " 18: Changing an option when entering diff mode
new
au OptionSet diff :let &l:cul=v:option_new