aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-06 23:45:06 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-06 23:48:15 -0400
commitfa1e740e60989134d5e6d623d687c1fd7c57909c (patch)
tree772920436fb4e466e59df1f2af74cdf77dfb15de
parenta260d5def363ca30f0473365ea514f2dedd0d0ba (diff)
downloadrneovim-fa1e740e60989134d5e6d623d687c1fd7c57909c.tar.gz
rneovim-fa1e740e60989134d5e6d623d687c1fd7c57909c.tar.bz2
rneovim-fa1e740e60989134d5e6d623d687c1fd7c57909c.zip
vim-patch:8.1.2325: crash when using balloon with empty line
Problem: Crash when using balloon with empty line. Solution: Handle empty lines. (Markus Braun) https://github.com/vim/vim/commit/9ae862ebba4a8962cb1c6811a2a46656fa672599 Port Test_balloon_split() from patch 8.0.1318 for merging only. It won't run because of the function check.
-rw-r--r--src/nvim/testdir/test_popup.vim47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim
index bb0ed6e00c..fb464d95ea 100644
--- a/src/nvim/testdir/test_popup.vim
+++ b/src/nvim/testdir/test_popup.vim
@@ -2,6 +2,7 @@
source shared.vim
source screendump.vim
+source check.vim
let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
let g:setting = ''
@@ -755,6 +756,52 @@ func Test_popup_and_previewwindow_dump()
call delete('Xscript')
endfunc
+func Test_balloon_split()
+ CheckFunction balloon_split
+
+ call assert_equal([
+ \ 'tempname: 0x555555e380a0 "/home/mool/.viminfz.tmp"',
+ \ ], balloon_split(
+ \ 'tempname: 0x555555e380a0 "/home/mool/.viminfz.tmp"'))
+ 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'))
+
+ eval 'struct = {one = 1, two = 2, three = 3}'
+ \ ->balloon_split()
+ \ ->assert_equal([
+ \ '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}'))
+ call assert_equal([
+ \ 'Some comment',
+ \ '',
+ \ 'typedef this that;',
+ \ ], balloon_split(
+ \ "Some comment\n\ntypedef this that;"))
+endfunc
+
func Test_popup_position()
if !CanRunVimInTerminal()
return