aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-07-16 01:35:43 +0200
committerGitHub <noreply@github.com>2019-07-16 01:35:43 +0200
commitb06f29318df5adab76bba32b89b9af22043a39cb (patch)
tree3f31cd9de6460a7d5eacc36a9f7f8a2d485e1e4a /test
parent046deeeaa18142455face461d2a5b8468dddae50 (diff)
downloadrneovim-b06f29318df5adab76bba32b89b9af22043a39cb.tar.gz
rneovim-b06f29318df5adab76bba32b89b9af22043a39cb.tar.bz2
rneovim-b06f29318df5adab76bba32b89b9af22043a39cb.zip
Fix missing CursorHoldI events (#3758)
Fixes https://github.com/neovim/neovim/issues/3757.
Diffstat (limited to 'test')
-rw-r--r--test/functional/autocmd/cursorhold_spec.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/functional/autocmd/cursorhold_spec.lua b/test/functional/autocmd/cursorhold_spec.lua
new file mode 100644
index 0000000000..506b688853
--- /dev/null
+++ b/test/functional/autocmd/cursorhold_spec.lua
@@ -0,0 +1,31 @@
+local helpers = require('test.functional.helpers')(after_each)
+
+local clear = helpers.clear
+local eq = helpers.eq
+local eval = helpers.eval
+local feed = helpers.feed
+local retry = helpers.retry
+local source = helpers.source
+local sleep = helpers.sleep
+
+describe('CursorHoldI', function()
+ before_each(clear)
+
+ -- NOTE: since this test uses RPC it is not necessary to trigger the initial
+ -- issue (#3757) via timer's or RPC callbacks in the first place.
+ it('is triggered after input', function()
+ source([[
+ set updatetime=1
+
+ let g:cursorhold = 0
+ augroup test
+ au CursorHoldI * let g:cursorhold += 1
+ augroup END
+ ]])
+ feed('ifoo')
+ retry(5, nil, function()
+ sleep(1)
+ eq(1, eval('g:cursorhold'))
+ end)
+ end)
+end)