Mercurial > vim
diff src/testdir/test_popup.vim @ 12883:058e93aee621 v8.0.1318
patch 8.0.1318: terminal balloon only shows one line
commit https://github.com/vim/vim/commit/246fe03d154c09070d5b7365b7f61716c4e0ddd4
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 19 19:56:27 2017 +0100
patch 8.0.1318: terminal balloon only shows one line
Problem: Terminal balloon only shows one line.
Solution: Split into several lines in a clever way. Add balloon_split().
Make balloon_show() accept a list in the terminal.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 19 Nov 2017 20:00:06 +0100 |
parents | c1347c968d31 |
children | ffc7004e9041 |
line wrap: on
line diff
--- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -703,4 +703,37 @@ func Test_popup_and_preview_autocommand( bw! endfunc +func Test_balloon_split() + call assert_equal([ + \ 'one two three four one two three four one two thre', + \ 'e four', + \ ], balloon_split( + \ 'one two three four one two three four one two three four')) + + call assert_equal([ + \ 'struct = {', + \ ' one = 1,', + \ ' two = 2,', + \ ' three = 3}', + \ ], balloon_split( + \ 'struct = {one = 1, two = 2, three = 3}')) + + call assert_equal([ + \ 'struct = {', + \ ' one = 1,', + \ ' nested = {', + \ ' n1 = "yes",', + \ ' n2 = "no"}', + \ ' two = 2}', + \ ], balloon_split( + \ 'struct = {one = 1, nested = {n1 = "yes", n2 = "no"} two = 2}')) + call assert_equal([ + \ 'struct = 0x234 {', + \ ' long = 2343 "\\"some long string that will be wr', + \ 'apped in two\\"",', + \ ' next = 123}', + \ ], balloon_split( + \ 'struct = 0x234 {long = 2343 "\\"some long string that will be wrapped in two\\"", next = 123}')) +endfunc + " vim: shiftwidth=2 sts=2 expandtab