diff src/testdir/test_balloon.vim @ 16594:6f52e82d9d4e v8.1.1300

patch 8.1.1300: in a terminal 'ballooneval' does not work right away commit https://github.com/vim/vim/commit/2f10658b06bbdd8f25c4ff152266c808234cee0a Author: Bram Moolenaar <Bram@vim.org> Date: Wed May 8 21:59:25 2019 +0200 patch 8.1.1300: in a terminal 'ballooneval' does not work right away Problem: In a terminal 'ballooneval' does not work right away. Solution: Flush output after drawing the balloon. Add the <Ignore> key code. Add a test.
author Bram Moolenaar <Bram@vim.org>
date Wed, 08 May 2019 22:00:05 +0200
parents
children fd0d29d63b85
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/src/testdir/test_balloon.vim
@@ -0,0 +1,32 @@
+" Tests for 'balloonevalterm'.
+
+if !has('balloon_eval_term') || has('gui_running')
+  finish
+endif
+
+source screendump.vim
+if !CanRunVimInTerminal()
+  finish
+endif
+
+func Test_balloon_eval_term()
+  call writefile([
+	\ 'call setline(1, ["one one one", "two tXo two", "three three three"])',
+	\ 'set balloonevalterm balloonexpr=MyBalloonExpr() balloondelay=100',
+	\ 'func MyBalloonExpr()',
+	\ ' return "line " . v:beval_lnum . " column " . v:beval_col',
+	\ 'endfun',
+	\ 'redraw',
+	\ 'call test_setmouse(2, 6)',
+	\ 'call feedkeys("\<MouseMove>\<Ignore>", "xt")',
+	\ ], 'XTest_beval')
+
+  " Check that the balloon shows up
+  let buf = RunVimInTerminal('-S XTest_beval', {'rows': 10, 'cols': 50})
+  call term_wait(buf, 100)
+  call VerifyScreenDump(buf, 'Test_balloon_eval_term_01', {})
+
+  " clean up
+  call StopVimInTerminal(buf)
+  call delete('XTest_beval')
+endfunc