summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-25 23:08:17 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-25 23:08:17 +0200
commit8e95636a282f3eac808c0e00c053b33334cc283e (patch)
treef2fdaf570a335324d8e861b68e2e632d32a0b07c
parent12034e22dd80cf533ac1c681be521ab299383f63 (diff)
downloadvim-git-8e95636a282f3eac808c0e00c053b33334cc283e.tar.gz
patch 8.1.1929: no tests for text property popup windowv8.1.1929
Problem: No tests for text property popup window. Solution: Add a few tests.
-rw-r--r--src/testdir/Make_all.mak2
-rw-r--r--src/testdir/dumps/Test_popup_textprop_01.dump10
-rw-r--r--src/testdir/dumps/Test_popup_textprop_02.dump10
-rw-r--r--src/testdir/dumps/Test_popup_textprop_03.dump10
-rw-r--r--src/testdir/dumps/Test_popup_textprop_04.dump10
-rw-r--r--src/testdir/dumps/Test_popup_textprop_05.dump10
-rw-r--r--src/testdir/dumps/Test_popup_textprop_06.dump10
-rw-r--r--src/testdir/test_popupwin_textprop.vim54
-rw-r--r--src/textprop.c3
-rw-r--r--src/version.c2
10 files changed, 119 insertions, 2 deletions
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak
index 80cf7068e..ee2a8f3f7 100644
--- a/src/testdir/Make_all.mak
+++ b/src/testdir/Make_all.mak
@@ -199,6 +199,7 @@ NEW_TESTS = \
test_plus_arg_edit \
test_popup \
test_popupwin \
+ test_popupwin_textprop \
test_preview \
test_profile \
test_prompt_buffer \
@@ -388,6 +389,7 @@ NEW_TESTS_RES = \
test_perl.res \
test_plus_arg_edit.res \
test_popupwin.res \
+ test_popupwin_textprop.res \
test_preview.res \
test_profile.res \
test_prompt_buffer.res \
diff --git a/src/testdir/dumps/Test_popup_textprop_01.dump b/src/testdir/dumps/Test_popup_textprop_01.dump
new file mode 100644
index 000000000..e85ea7e8e
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_textprop_01.dump
@@ -0,0 +1,10 @@
+|4+0&#ffffff0|6| @72
+|4|7| @14|╔+0#0000001#ffd7ff255|═@9|╗| +0#0000000#ffffff0@45
+|4|8| @14|║+0#0000001#ffd7ff255| |t|h|e| |t|e|x|t| |║| +0#0000000#ffffff0@45
+|4|9| @14|╚+0#0000001#ffd7ff255|═@9|╝| +0#0000000#ffffff0@45
+>s|o|m|e| |t|e|x|t| |t+0&#5fd7ff255|o| |w|o|r|k| +0&#ffffff0|w|i|t|h| @52
+|5|1| @72
+|5|2| @72
+|5|3| @72
+|5|4| @72
+@57|5|0|,|1| @9|4|9|%|
diff --git a/src/testdir/dumps/Test_popup_textprop_02.dump b/src/testdir/dumps/Test_popup_textprop_02.dump
new file mode 100644
index 000000000..58fdc2857
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_textprop_02.dump
@@ -0,0 +1,10 @@
+>s+0&#ffffff0|o|m|e| |t|e|x|t| |t+0&#5fd7ff255|o| |w|o|r|k| +0&#ffffff0|w|i|t|h| @52
+|5|1| @14|╔+0#0000001#ffd7ff255|═@9|╗| +0#0000000#ffffff0@45
+|5|2| @14|║+0#0000001#ffd7ff255| |t|h|e| |t|e|x|t| |║| +0#0000000#ffffff0@45
+|5|3| @14|╚+0#0000001#ffd7ff255|═@9|╝| +0#0000000#ffffff0@45
+|5|4| @72
+|5@1| @72
+|5|6| @72
+|5|7| @72
+|5|8| @72
+@57|5|0|,|1| @9|5|3|%|
diff --git a/src/testdir/dumps/Test_popup_textprop_03.dump b/src/testdir/dumps/Test_popup_textprop_03.dump
new file mode 100644
index 000000000..efc685395
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_textprop_03.dump
@@ -0,0 +1,10 @@
+|4+0&#ffffff0|6| @72
+|4|7| @17|╔+0#0000001#ffd7ff255|═@9|╗| +0#0000000#ffffff0@42
+|4|8| @17|║+0#0000001#ffd7ff255| |t|h|e| |t|e|x|t| |║| +0#0000000#ffffff0@42
+|4|9| @17|╚+0#0000001#ffd7ff255|═@9|╝| +0#0000000#ffffff0@42
+|a|w>e|s|o|m|e| |t|e|x|t| |t+0&#5fd7ff255|o| |w|o|r|k| +0&#ffffff0|w|i|t|h| @49
+|5|1| @72
+|5|2| @72
+|5|3| @72
+|5|4| @72
+@57|5|0|,|3| @9|4|9|%|
diff --git a/src/testdir/dumps/Test_popup_textprop_04.dump b/src/testdir/dumps/Test_popup_textprop_04.dump
new file mode 100644
index 000000000..b8179c686
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_textprop_04.dump
@@ -0,0 +1,10 @@
+|4+0&#ffffff0|6| @72
+|4|7| @9|╔+0#0000001#ffd7ff255|═@9|╗| +0#0000000#ffffff0@50
+|4|8| @9|║+0#0000001#ffd7ff255| |t|h|e| |t|e|x|t| |║| +0#0000000#ffffff0@50
+|4|9| @9|╚+0#0000001#ffd7ff255|═@9|╝| +0#0000000#ffffff0@50
+>t|e|x|t| |t+0&#5fd7ff255|o| |w|o|r|k| +0&#ffffff0|w|i|t|h| @57
+|5|1| @72
+|5|2| @72
+|5|3| @72
+|5|4| @72
+@57|5|0|,|1| @9|4|9|%|
diff --git a/src/testdir/dumps/Test_popup_textprop_05.dump b/src/testdir/dumps/Test_popup_textprop_05.dump
new file mode 100644
index 000000000..78ae14227
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_textprop_05.dump
@@ -0,0 +1,10 @@
+|4+0&#ffffff0|6| @72
+|4|7| @72
+|4|8| @9|╔+0#0000001#ffd7ff255|═@9|╗| +0#0000000#ffffff0@50
+|4|9| @9|║+0#0000001#ffd7ff255| |t|h|e| |t|e|x|t| |║| +0#0000000#ffffff0@50
+|i|n|s|e|r|t|e>d| @3|╚+0#0000001#ffd7ff255|═@9|╝| +0#0000000#ffffff0@50
+|t|e|x|t| |t+0&#5fd7ff255|o| |w|o|r|k| +0&#ffffff0|w|i|t|h| @57
+|5|1| @72
+|5|2| @72
+|5|3| @72
+@57|5|0|,|8| @9|4|8|%|
diff --git a/src/testdir/dumps/Test_popup_textprop_06.dump b/src/testdir/dumps/Test_popup_textprop_06.dump
new file mode 100644
index 000000000..232799839
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_textprop_06.dump
@@ -0,0 +1,10 @@
+|4+0&#ffffff0|6| @9|╔+0#0000001#ffd7ff255|═@9|╗| +0#0000000#ffffff0@50
+|4|7| @9|║+0#0000001#ffd7ff255| |t|h|e| |t|e|x|t| |║| +0#0000000#ffffff0@50
+|4|8| @9|╚+0#0000001#ffd7ff255|═@9|╝| +0#0000000#ffffff0@50
+>t|e|x|t| |t+0&#5fd7ff255|o| |w|o|r|k| +0&#ffffff0|w|i|t|h| @57
+|5|1| @72
+|5|2| @72
+|5|3| @72
+|5|4| @72
+|5@1| @72
+@57|4|9|,|1| @9|5|0|%|
diff --git a/src/testdir/test_popupwin_textprop.vim b/src/testdir/test_popupwin_textprop.vim
new file mode 100644
index 000000000..26950de96
--- /dev/null
+++ b/src/testdir/test_popupwin_textprop.vim
@@ -0,0 +1,54 @@
+" Tests for popup windows for text properties
+
+source check.vim
+CheckFeature textprop
+
+source screendump.vim
+CheckScreendump
+
+func Test_textprop_popup()
+ let lines =<< trim END
+ call setline(1, range(1, 100))
+ call setline(50, 'some text to work with')
+ 50
+ normal zz
+ set scrolloff=0
+ call prop_type_add('popupMarker', #{highlight: 'DiffAdd'})
+ call prop_add(50, 11, #{
+ \ length: 7,
+ \ type: 'popupMarker',
+ \ })
+ let winid = popup_create('the text', #{
+ \ pos: 'botleft',
+ \ textprop: 'popupMarker',
+ \ border: [],
+ \ padding: [0,1,0,1],
+ \ close: 'click',
+ \ })
+ END
+ call writefile(lines, 'XtestTextpropPopup')
+ let buf = RunVimInTerminal('-S XtestTextpropPopup', #{rows: 10})
+ call VerifyScreenDump(buf, 'Test_popup_textprop_01', {})
+
+ call term_sendkeys(buf, "zt")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_02', {})
+
+ call term_sendkeys(buf, "zzIawe\<Esc>")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_03', {})
+
+ call term_sendkeys(buf, "0dw")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_04', {})
+
+ call term_sendkeys(buf, "Oinserted\<Esc>")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_05', {})
+
+ call term_sendkeys(buf, "k2dd")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_06', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('XtestTextpropPopup')
+endfunc
+
+
+" vim: shiftwidth=2 sts=2
diff --git a/src/textprop.c b/src/textprop.c
index 7947d348f..cc95546e2 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -396,8 +396,7 @@ find_visible_prop(win_T *wp, int type_id, int id, textprop_T *prop,
int i;
// w_botline may not have been updated yet.
- if (wp->w_botline > wp->w_buffer->b_ml.ml_line_count)
- wp->w_botline = wp->w_buffer->b_ml.ml_line_count + 1;
+ validate_botline();
for (lnum = wp->w_topline; lnum < wp->w_botline; ++lnum)
{
count = get_text_props(wp->w_buffer, lnum, &props, FALSE);
diff --git a/src/version.c b/src/version.c
index e317c8fd1..1e628fd74 100644
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1929,
+/**/
1928,
/**/
1927,