comparison src/testdir/test_balloon.vim @ 17282:6f1679e1082d v8.1.1640

patch 8.1.1640: the CursorHold autocommand takes down a balloon commit https://github.com/vim/vim/commit/c2f5054be9301c8a47b92a4584338cb2de24b96c Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 5 23:24:56 2019 +0200 patch 8.1.1640: the CursorHold autocommand takes down a balloon Problem: The CursorHold autocommand takes down a balloon. (Paul Jolly) Solution: Ignore the CursorHold pseudo-key.
author Bram Moolenaar <Bram@vim.org>
date Fri, 05 Jul 2019 23:30:06 +0200
parents 6990c1160ea5
children 0da9bc55c31a
comparison
equal deleted inserted replaced
17281:0f11ef19b3d3 17282:6f1679e1082d
23 [CODE] 23 [CODE]
24 24
25 func Test_balloon_eval_term() 25 func Test_balloon_eval_term()
26 " Use <Ignore> after <MouseMove> to return from vgetc() without removing 26 " Use <Ignore> after <MouseMove> to return from vgetc() without removing
27 " the balloon. 27 " the balloon.
28 call writefile(s:common_script + [ 28 let xtra_lines =<< trim [CODE]
29 \ 'call test_setmouse(2, 6)', 29 set updatetime=300
30 \ 'call feedkeys("\<MouseMove>\<Ignore>", "xt")', 30 au CursorHold * echo 'hold fired'
31 \ ], 'XTest_beval') 31 func Trigger()
32 call test_setmouse(2, 6)
33 call feedkeys("\<MouseMove>\<Ignore>", "xt")
34 endfunc
35 [CODE]
36 call writefile(s:common_script + xtra_lines, 'XTest_beval')
32 37
33 " Check that the balloon shows up after a mouse move 38 " Check that the balloon shows up after a mouse move
34 let buf = RunVimInTerminal('-S XTest_beval', {'rows': 10, 'cols': 50}) 39 let buf = RunVimInTerminal('-S XTest_beval', {'rows': 10, 'cols': 50})
35 call term_wait(buf, 100) 40 call term_wait(buf, 100)
41 call term_sendkeys(buf, 'll')
42 call term_sendkeys(buf, ":call Trigger()\<CR>")
36 call VerifyScreenDump(buf, 'Test_balloon_eval_term_01', {}) 43 call VerifyScreenDump(buf, 'Test_balloon_eval_term_01', {})
44
45 " Make sure the balloon still shows after 'updatetime' passed and CursorHold
46 " was triggered.
47 call term_wait(buf, 300)
48 call VerifyScreenDump(buf, 'Test_balloon_eval_term_01a', {})
37 49
38 " clean up 50 " clean up
39 call StopVimInTerminal(buf) 51 call StopVimInTerminal(buf)
40 call delete('XTest_beval') 52 call delete('XTest_beval')
41 endfunc 53 endfunc