summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-28 22:18:30 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-28 22:18:30 +0200
commitbc2d4c1db6d47f6d04412bb5f94b52e444faebc8 (patch)
tree4bae08a8052e6083ba8b5831ba5d42f7c53def65
parent0522ba0359c96a8c2a4fc8fca0d3b58e49dda759 (diff)
downloadvim-git-bc2d4c1db6d47f6d04412bb5f94b52e444faebc8.tar.gz
patch 8.1.1934: not enough tests for text property popup windowv8.1.1934
Problem: Not enough tests for text property popup window. Solution: Add a few more tests.
-rw-r--r--src/popupwin.c2
-rw-r--r--src/testdir/dumps/Test_popup_textprop_corn_1.dump12
-rw-r--r--src/testdir/dumps/Test_popup_textprop_corn_2.dump12
-rw-r--r--src/testdir/dumps/Test_popup_textprop_corn_3.dump12
-rw-r--r--src/testdir/dumps/Test_popup_textprop_corn_4.dump12
-rw-r--r--src/testdir/test_popupwin_textprop.vim53
-rw-r--r--src/version.c2
7 files changed, 104 insertions, 1 deletions
diff --git a/src/popupwin.c b/src/popupwin.c
index bf1205517..4dadee6ef 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -1103,7 +1103,7 @@ popup_adjust_position(win_T *wp)
wantcol = screen_ecol + wantcol;
else
// left of the text
- wantcol = screen_scol + wantcol - 1;
+ wantcol = screen_scol + wantcol - 2;
}
if (wp->w_popup_pos == POPPOS_CENTER)
diff --git a/src/testdir/dumps/Test_popup_textprop_corn_1.dump b/src/testdir/dumps/Test_popup_textprop_corn_1.dump
new file mode 100644
index 000000000..ac18c999f
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_textprop_corn_1.dump
@@ -0,0 +1,12 @@
+|4+0&#ffffff0|5| @72
+|4|6| @72
+|4|7| @3|╔+0#0000001#ffd7ff255|═@13|╗| +0#0000000#ffffff0@52
+|4|8| @3|║+0#0000001#ffd7ff255| |b|o|t@1|o|m| |r|i|g|h|t| |║| +0#0000000#ffffff0@52
+|4|9| @3|╚+0#0000001#ffd7ff255|═@13|╝| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255|b|o|t@1|o|m| |l|e|f|t| | +0#0000000#ffffff0@33
+>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| @8| +0#0000001#ffd7ff255|t|o|p| |r|i|g|h|t| | +0#0000000#ffffff0@5|╔+0#0000001#ffd7ff255|═@9|╗| +0#0000000#ffffff0@34
+|5|2| @25|║+0#0000001#ffd7ff255| |t|o|p| |l|e|f|t| |║| +0#0000000#ffffff0@34
+|5|3| @25|╚+0#0000001#ffd7ff255|═@9|╝| +0#0000000#ffffff0@34
+|5|4| @72
+|5@1| @72
+@57|5|0|,|1| @9|4|9|%|
diff --git a/src/testdir/dumps/Test_popup_textprop_corn_2.dump b/src/testdir/dumps/Test_popup_textprop_corn_2.dump
new file mode 100644
index 000000000..b7be5dd8c
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_textprop_corn_2.dump
@@ -0,0 +1,12 @@
+|4+0&#ffffff0|5| @72
+|4|6| @72
+|4|7|╔+0#0000001#ffd7ff255|═@13|╗| +0#0000000#ffffff0@56
+|4|8|║+0#0000001#ffd7ff255| |b|o|t@1|o|m| |r|i|g|h|t| |║| +0#0000000#ffffff0@56
+|4|9|╚+0#0000001#ffd7ff255|═@13|╝| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255|b|o|t@1|o|m| |l|e|f|t| | +0#0000000#ffffff0@37
+>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| @40
+|5|1| @4| +0#0000001#ffd7ff255|t|o|p| |r|i|g|h|t| | +0#0000000#ffffff0@5|╔+0#0000001#ffd7ff255|═@9|╗| +0#0000000#ffffff0@38
+|5|2| @21|║+0#0000001#ffd7ff255| |t|o|p| |l|e|f|t| |║| +0#0000000#ffffff0@38
+|5|3| @21|╚+0#0000001#ffd7ff255|═@9|╝| +0#0000000#ffffff0@38
+|5|4| @72
+|5@1| @72
+@57|5|0|,|1| @9|4|9|%|
diff --git a/src/testdir/dumps/Test_popup_textprop_corn_3.dump b/src/testdir/dumps/Test_popup_textprop_corn_3.dump
new file mode 100644
index 000000000..bd77c0784
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_textprop_corn_3.dump
@@ -0,0 +1,12 @@
+|4+0&#ffffff0|5| @72
+|4|6| @72
+|e|x|t|r>a| @69
+|4|7|╔+0#0000001#ffd7ff255|═@13|╗| +0#0000000#ffffff0@56
+|4|8|║+0#0000001#ffd7ff255| |b|o|t@1|o|m| |r|i|g|h|t| |║| +0#0000000#ffffff0@56
+|4|9|╚+0#0000001#ffd7ff255|═@13|╝| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255|b|o|t@1|o|m| |l|e|f|t| | +0#0000000#ffffff0@37
+|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| @40
+|5|1| @4| +0#0000001#ffd7ff255|t|o|p| |r|i|g|h|t| | +0#0000000#ffffff0@5|╔+0#0000001#ffd7ff255|═@9|╗| +0#0000000#ffffff0@38
+|5|2| @21|║+0#0000001#ffd7ff255| |t|o|p| |l|e|f|t| |║| +0#0000000#ffffff0@38
+|5|3| @21|╚+0#0000001#ffd7ff255|═@9|╝| +0#0000000#ffffff0@38
+|5|4| @72
+@57|4|7|,|5| @9|4|8|%|
diff --git a/src/testdir/dumps/Test_popup_textprop_corn_4.dump b/src/testdir/dumps/Test_popup_textprop_corn_4.dump
new file mode 100644
index 000000000..7bf10b24b
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_textprop_corn_4.dump
@@ -0,0 +1,12 @@
+|4+0&#ffffff0|5| @72
+>4|6| @72
+|4|7|╔+0#0000001#ffd7ff255|═@13|╗| +0#0000000#ffffff0@56
+|4|8|║+0#0000001#ffd7ff255| |b|o|t@1|o|m| |r|i|g|h|t| |║| +0#0000000#ffffff0@56
+|4|9|╚+0#0000001#ffd7ff255|═@13|╝| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255|b|o|t@1|o|m| |l|e|f|t| | +0#0000000#ffffff0@37
+|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| @40
+|5|1| @4| +0#0000001#ffd7ff255|t|o|p| |r|i|g|h|t| | +0#0000000#ffffff0@5|╔+0#0000001#ffd7ff255|═@9|╗| +0#0000000#ffffff0@38
+|5|2| @21|║+0#0000001#ffd7ff255| |t|o|p| |l|e|f|t| |║| +0#0000000#ffffff0@38
+|5|3| @21|╚+0#0000001#ffd7ff255|═@9|╝| +0#0000000#ffffff0@38
+|5|4| @72
+|5@1| @72
+|1| |l|i|n|e| |l|e|s@1|;| |b|e|f|o|r|e| |#|3| @1|1| |s|e|c|o|n|d| |a|g|o| @20|4|6|,|1| @9|4|9|%|
diff --git a/src/testdir/test_popupwin_textprop.vim b/src/testdir/test_popupwin_textprop.vim
index 26950de96..491381592 100644
--- a/src/testdir/test_popupwin_textprop.vim
+++ b/src/testdir/test_popupwin_textprop.vim
@@ -50,5 +50,58 @@ func Test_textprop_popup()
call delete('XtestTextpropPopup')
endfunc
+func Test_textprop_popup_corners()
+ 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',
+ \ textprop: 'popupMarker',
+ \ padding: [0,1,0,1],
+ \ })
+ let winid = popup_create('bottom right', #{
+ \ pos: 'botright',
+ \ textprop: 'popupMarker',
+ \ border: [],
+ \ padding: [0,1,0,1],
+ \ })
+ let winid = popup_create('top left', #{
+ \ pos: 'topleft',
+ \ textprop: 'popupMarker',
+ \ border: [],
+ \ padding: [0,1,0,1],
+ \ })
+ let winid = popup_create('top right', #{
+ \ pos: 'topright',
+ \ textprop: 'popupMarker',
+ \ padding: [0,1,0,1],
+ \ })
+ END
+ call writefile(lines, 'XtestTextpropPopupCorners')
+ let buf = RunVimInTerminal('-S XtestTextpropPopupCorners', #{rows: 12})
+ call VerifyScreenDump(buf, 'Test_popup_textprop_corn_1', {})
+
+ call term_sendkeys(buf, "0dw")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_corn_2', {})
+
+ call term_sendkeys(buf, "46Goextra\<Esc>")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_corn_3', {})
+
+ call term_sendkeys(buf, "u")
+ call VerifyScreenDump(buf, 'Test_popup_textprop_corn_4', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('XtestTextpropPopupCorners')
+endfunc
+
" vim: shiftwidth=2 sts=2
diff --git a/src/version.c b/src/version.c
index 33bf502d3..966c5b76c 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 */
/**/
+ 1934,
+/**/
1933,
/**/
1932,