summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-29 20:02:11 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-29 20:02:11 +0200
commit1fb0831a0e9f9b6f18f1f8b549191bd547d0e095 (patch)
treeb16ad034de403accb4d2cd0e27a1a4e73e7b4b99 /src/testdir
parent57441d6fa0ba44be8dc16d6469a8659afc2f3b81 (diff)
patch 8.1.1936: not enough tests for text property popup windowv8.1.1936
Problem: Not enough tests for text property popup window. Solution: Add a few more tests. Make negative offset work. Close all popups when window closes.
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/dumps/Test_popup_textprop_07.dump10
-rw-r--r--src/testdir/dumps/Test_popup_textprop_corn_5.dump12
-rw-r--r--src/testdir/dumps/Test_popup_textprop_corn_6.dump12
-rw-r--r--src/testdir/dumps/Test_popup_textprop_off_1.dump12
-rw-r--r--src/testdir/dumps/Test_popup_textprop_off_2.dump12
-rw-r--r--src/testdir/test_popupwin_textprop.vim65
6 files changed, 123 insertions, 0 deletions
diff --git a/src/testdir/dumps/Test_popup_textprop_07.dump b/src/testdir/dumps/Test_popup_textprop_07.dump
new file mode 100644
index 0000000000..2950ddc8c0
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_textprop_07.dump
@@ -0,0 +1,10 @@
+>5+0&#ffffff0|1| @72
+|5|2| @72
+|5|3| @72
+|5|4| @72
+|5@1| @72
+|5|6| @72
+|5|7| @72
+|5|8| @72
+|5|9| @72
+@57|5|0|,|1| @9|5|4|%|
diff --git a/src/testdir/dumps/Test_popup_textprop_corn_5.dump b/src/testdir/dumps/Test_popup_textprop_corn_5.dump
new file mode 100644
index 0000000000..c79e8986a3
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_textprop_corn_5.dump
@@ -0,0 +1,12 @@
+> +0&#ffffff0@36||+1&&|4+0&&|5| @34
+|~+0#4040ff13&| @35||+1#0000000&|4+0&&|6| @34
+|~+0#4040ff13&| @35||+1#0000000&|4+0&&|7|╔+0#0000001#ffd7ff255|═@13|╗| +0#0000000#ffffff0@18
+|~+0#4040ff13&| @35||+1#0000000&|4+0&&|8|║+0#0000001#ffd7ff255| |b|o|t@1|o|m| |r|i|g|h|t| |║| +0#0000000#ffffff0@18
+|~+0#4040ff13&| @35||+1#0000000&|4+0&&|9|╚+0#0000001#ffd7ff255|═@13|╝| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255|b|o|t@1|o|m| |l|e|f|t|
+|~+0#4040ff13#ffffff0| @35||+1#0000000&|w+0&&|o|r|k|i|n|g| |w|i|t|h| |s|o|m|e| |l+0&#5fd7ff255|o|n|g|e|r| +0&#ffffff0|t|e|x|t| |h|e|r|e| @2
+|~+0#4040ff13&| @35||+1#0000000&|5+0&&|1| @4| +0#0000001#ffd7ff255|t|o|p| |r|i|g|h|t| | +0#0000000#ffffff0@5|╔+0#0000001#ffd7ff255|═@9|╗| +0#0000000#ffffff0
+|~+0#4040ff13&| @35||+1#0000000&|5+0&&|2| @21|║+0#0000001#ffd7ff255| |t|o|p| |l|e|f|t| |║| +0#0000000#ffffff0
+|~+0#4040ff13&| @35||+1#0000000&|5+0&&|3| @21|╚+0#0000001#ffd7ff255|═@9|╝| +0#0000000#ffffff0
+|~+0#4040ff13&| @35||+1#0000000&|5+0&&|4| @34
+|f+3&&|o@1| @15|0|,|0|-|1| @9|A|l@1| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @5|4|6|,|1| @10|4|8|%
+|"+0&&|f|o@1|"| |[|N|e|w| |F|i|l|e|]| @58
diff --git a/src/testdir/dumps/Test_popup_textprop_corn_6.dump b/src/testdir/dumps/Test_popup_textprop_corn_6.dump
new file mode 100644
index 0000000000..7e6426c699
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_textprop_corn_6.dump
@@ -0,0 +1,12 @@
+> +0&#ffffff0@74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&|o|n|l|y|!| @50|0|,|0|-|1| @8|A|l@1|
diff --git a/src/testdir/dumps/Test_popup_textprop_off_1.dump b/src/testdir/dumps/Test_popup_textprop_off_1.dump
new file mode 100644
index 0000000000..33f2978223
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_textprop_off_1.dump
@@ -0,0 +1,12 @@
+|4+0&#ffffff0|5| @72
+|4|6| @1|╔+0#0000001#ffd7ff255|═@13|╗| +0#0000000#ffffff0@54
+|4|7| @1|║+0#0000001#ffd7ff255| |b|o|t@1|o|m| |r|i|g|h|t| |║| +0#0000000#ffffff0@54
+|4|8| @1|╚+0#0000001#ffd7ff255|═@13|╝| +0#0000000#ffffff0@9| +0#0000001#ffd7ff255|b|o|t@1|o|m| |l|e|f|t| | +0#0000000#ffffff0@31
+|4|9| @72
+>n|o|w| |w|o|r|k|i|n|g| |w|i|t|h| |s|o|m|e| |l+0&#5fd7ff255|o|n|g|e|r| +0&#ffffff0|t|e|x|t| |h|e|r|e| @36
+|5|1| @72
+|5|2| @6| +0#0000001#ffd7ff255|t|o|p| |r|i|g|h|t| | +0#0000000#ffffff0@9|╔+0#0000001#ffd7ff255|═@9|╗| +0#0000000#ffffff0@32
+|5|3| @27|║+0#0000001#ffd7ff255| |t|o|p| |l|e|f|t| |║| +0#0000000#ffffff0@32
+|5|4| @27|╚+0#0000001#ffd7ff255|═@9|╝| +0#0000000#ffffff0@32
+|5@1| @72
+@57|5|0|,|1| @9|4|9|%|
diff --git a/src/testdir/dumps/Test_popup_textprop_off_2.dump b/src/testdir/dumps/Test_popup_textprop_off_2.dump
new file mode 100644
index 0000000000..1896c641c1
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_textprop_off_2.dump
@@ -0,0 +1,12 @@
+|4+0&#ffffff0|5| @72
+|4|6| @72
+|4|7| @72
+|4|8| @72
+|4|9| @72
+>n|o|w| |w|o|r|k|i|n|g| |w|i|t|h| |s|o|m|e| |l|o|n|g|e|r| |t|e|x|t| |h|e|r|e| @36
+|5|1| @72
+|5|2| @72
+|5|3| @72
+|5|4| @72
+|5@1| @72
+|:|c|a|l@1| |p|r|o|p|_|c|l|e|a|r|(|5|0|)| @36|5|0|,|1| @9|4|9|%|
diff --git a/src/testdir/test_popupwin_textprop.vim b/src/testdir/test_popupwin_textprop.vim
index 2a4eb2cd0d..8a68f15d7e 100644
--- a/src/testdir/test_popupwin_textprop.vim
+++ b/src/testdir/test_popupwin_textprop.vim
@@ -45,6 +45,9 @@ func Test_textprop_popup()
call term_sendkeys(buf, "k2dd")
call VerifyScreenDump(buf, 'Test_popup_textprop_06', {})
+ call term_sendkeys(buf, "4\<C-E>")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_07', {})
+
" clean up
call StopVimInTerminal(buf)
call delete('XtestTextpropPopup')
@@ -99,10 +102,72 @@ func Test_textprop_popup_corners()
call term_sendkeys(buf, ":\<CR>")
call VerifyScreenDump(buf, 'Test_popup_textprop_corn_4', {})
+ call term_sendkeys(buf, ":vsplit foo\<CR>")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_corn_5', {})
+
+ call term_sendkeys(buf, ":only!\<CR>")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_corn_6', {})
+
" clean up
call StopVimInTerminal(buf)
call delete('XtestTextpropPopupCorners')
endfunc
+func Test_textprop_popup_offsets()
+ let lines =<< trim END
+ call setline(1, range(1, 100))
+ call setline(50, 'now working with some longer text here')
+ 50
+ normal zz
+ set scrolloff=0
+ call prop_type_add('popupMarker', #{highlight: 'DiffAdd'})
+ call prop_add(50, 23, #{
+ \ length: 6,
+ \ type: 'popupMarker',
+ \ })
+ let winid = popup_create('bottom left', #{
+ \ pos: 'botleft',
+ \ line: -1,
+ \ col: 2,
+ \ textprop: 'popupMarker',
+ \ padding: [0,1,0,1],
+ \ })
+ let winid = popup_create('bottom right', #{
+ \ pos: 'botright',
+ \ line: -1,
+ \ col: -2,
+ \ textprop: 'popupMarker',
+ \ border: [],
+ \ padding: [0,1,0,1],
+ \ })
+ let winid = popup_create('top left', #{
+ \ pos: 'topleft',
+ \ line: 1,
+ \ col: 2,
+ \ textprop: 'popupMarker',
+ \ border: [],
+ \ padding: [0,1,0,1],
+ \ })
+ let winid = popup_create('top right', #{
+ \ pos: 'topright',
+ \ line: 1,
+ \ col: -2,
+ \ textprop: 'popupMarker',
+ \ padding: [0,1,0,1],
+ \ })
+ END
+ call writefile(lines, 'XtestTextpropPopupOffset')
+ let buf = RunVimInTerminal('-S XtestTextpropPopupOffset', #{rows: 12})
+ call VerifyScreenDump(buf, 'Test_popup_textprop_off_1', {})
+
+ " test that removing the text property closes the popups
+ call term_sendkeys(buf, ":call prop_clear(50)\<CR>")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_off_2', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('XtestTextpropPopupOffset')
+endfunc
+
" vim: shiftwidth=2 sts=2