]> granicus.if.org Git - vim/commitdiff
patch 8.1.1640: the CursorHold autocommand takes down a balloon v8.1.1640
authorBram Moolenaar <Bram@vim.org>
Fri, 5 Jul 2019 21:24:56 +0000 (23:24 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 5 Jul 2019 21:24:56 +0000 (23:24 +0200)
Problem:    The CursorHold autocommand takes down a balloon. (Paul Jolly)
Solution:   Ignore the CursorHold pseudo-key.

src/getchar.c
src/testdir/dumps/Test_balloon_eval_term_01.dump
src/testdir/dumps/Test_balloon_eval_term_01a.dump [new file with mode: 0644]
src/testdir/test_balloon.vim
src/version.c

index f6734a79a611ea5acefff5eb3ab99701ecdb5f66..e0c8fdad73d7ecc76a6b6d5281ac5d14422c33b0 100644 (file)
@@ -1794,7 +1794,7 @@ vgetc(void)
     may_garbage_collect = FALSE;
 #endif
 #ifdef FEAT_BEVAL_TERM
-    if (c != K_MOUSEMOVE && c != K_IGNORE)
+    if (c != K_MOUSEMOVE && c != K_IGNORE && c != K_CURSORHOLD)
     {
        /* Don't trigger 'balloonexpr' unless only the mouse was moved. */
        bevalexpr_due_set = FALSE;
index 4ffeb8f1188c0dc98f4959c0daaf7f877fa80c1e..e4fe652e82e02d4a2fe433bff67dcc5b80031ef3 100644 (file)
@@ -1,4 +1,4 @@
->o+0&#ffffff0|n|e| |o|n|e| |o|n|e| @38
+|o+0&#ffffff0|n>e| |o|n|e| |o|n|e| @38
 @2|o| |t|X|o| |t|w|o| @38
 |t|h|r|e| +0#0000001#ffd7ff255@21| +0#0000000#ffffff0@23
 |~+0#4040ff13&| @2| +0#0000001#ffd7ff255|l|i|n|e| |2| |c|o|l|u|m|n| |6|:| |t|X|o| | +0#4040ff13#ffffff0@23
@@ -7,4 +7,4 @@
 |~| @48
 |~| @48
 |~| @48
-| +0#0000000&@31|1|,|1| @10|A|l@1| 
+|:+0#0000000&|c|a|l@1| |T|r|i|g@1|e|r|(|)| @16|1|,|3| @10|A|l@1| 
diff --git a/src/testdir/dumps/Test_balloon_eval_term_01a.dump b/src/testdir/dumps/Test_balloon_eval_term_01a.dump
new file mode 100644 (file)
index 0000000..d2194c8
--- /dev/null
@@ -0,0 +1,10 @@
+|o+0&#ffffff0|n>e| |o|n|e| |o|n|e| @38
+@2|o| |t|X|o| |t|w|o| @38
+|t|h|r|e| +0#0000001#ffd7ff255@21| +0#0000000#ffffff0@23
+|~+0#4040ff13&| @2| +0#0000001#ffd7ff255|l|i|n|e| |2| |c|o|l|u|m|n| |6|:| |t|X|o| | +0#4040ff13#ffffff0@23
+|~| @2| +0#0000001#ffd7ff255@21| +0#4040ff13#ffffff0@23
+|~| @48
+|~| @48
+|~| @48
+|~| @48
+|h+0#0000000&|o|l|d| |f|i|r|e|d| @39
index b3c680e1116a1e3673b384e7db3bdb1d6b2f0ce1..796cb23f673798edf7e8806931fb29ad604d8d6f 100644 (file)
@@ -25,16 +25,28 @@ let s:common_script =<< trim [CODE]
 func Test_balloon_eval_term()
   " Use <Ignore> after <MouseMove> to return from vgetc() without removing
   " the balloon.
-  call writefile(s:common_script + [
-       \ 'call test_setmouse(2, 6)',
-       \ 'call feedkeys("\<MouseMove>\<Ignore>", "xt")',
-       \ ], 'XTest_beval')
+  let xtra_lines =<< trim [CODE]
+    set updatetime=300
+    au CursorHold * echo 'hold fired'
+    func Trigger()
+      call test_setmouse(2, 6)
+      call feedkeys("\<MouseMove>\<Ignore>", "xt")
+    endfunc
+  [CODE]
+  call writefile(s:common_script + xtra_lines, 'XTest_beval')
 
   " Check that the balloon shows up after a mouse move
   let buf = RunVimInTerminal('-S XTest_beval', {'rows': 10, 'cols': 50})
   call term_wait(buf, 100)
+  call term_sendkeys(buf, 'll')
+  call term_sendkeys(buf, ":call Trigger()\<CR>")
   call VerifyScreenDump(buf, 'Test_balloon_eval_term_01', {})
 
+  " Make sure the balloon still shows after 'updatetime' passed and CursorHold
+  " was triggered.
+  call term_wait(buf, 300)
+  call VerifyScreenDump(buf, 'Test_balloon_eval_term_01a', {})
+
   " clean up
   call StopVimInTerminal(buf)
   call delete('XTest_beval')
index 25c6076b02657301587a3a39686e6944138aefff..85cf7b2e21f1ecd608feffeb0abe954a30b293d4 100644 (file)
@@ -777,6 +777,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1640,
 /**/
     1639,
 /**/