diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-05-08 21:59:25 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-05-08 21:59:25 +0200 |
commit | 2f10658b06bbdd8f25c4ff152266c808234cee0a (patch) | |
tree | 8227dc063a5f4f258563f74adf09326a7d57dae0 /src/testdir/test_balloon.vim | |
parent | a5c6a0b6c71ae11078cbf6f5e18ce49a0468a117 (diff) |
patch 8.1.1300: in a terminal 'ballooneval' does not work right awayv8.1.1300
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.
Diffstat (limited to 'src/testdir/test_balloon.vim')
-rw-r--r-- | src/testdir/test_balloon.vim | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/testdir/test_balloon.vim b/src/testdir/test_balloon.vim new file mode 100644 index 0000000000..e5187557a2 --- /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 |