summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-30 17:58:27 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-30 17:58:27 +0100
commit20ebbeac461ffc2a5e5dbfbb0ba380b8854615bd (patch)
tree111206818a0c610bf163767bbc4c72708c5fde4a
parent91359014b359cf816bf943fe2c7d492996263def (diff)
patch 8.1.2365: missing tests for recent popupwin changesv8.1.2365
Problem: Missing tests for recent popupwin changes. Solution: Add test cases.
-rw-r--r--src/testdir/test_popupwin.vim58
-rw-r--r--src/version.c2
2 files changed, 60 insertions, 0 deletions
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 8ca7f1c574..653ee49d9e 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -3053,4 +3053,62 @@ func Test_popupwin_filter_redraw()
delfunc CloseFilter
endfunc
+func Test_popupwin_double_width()
+ CheckScreendump
+
+ let lines =<< trim END
+ call setline(1, 'x你好世界你好世你好世界你好')
+ call setline(2, '你好世界你好世你好世界你好')
+ call setline(3, 'x你好世界你好世你好世界你好')
+ call popup_create('你好,世界 - 你好,世界xxxxx', #{line: 1, col: 3, maxwidth: 14})
+ END
+ call writefile(lines, 'XtestPopupWide')
+
+ let buf = RunVimInTerminal('-S XtestPopupWide', #{rows: 10})
+ call VerifyScreenDump(buf, 'Test_popupwin_doublewidth_1', {})
+
+ call StopVimInTerminal(buf)
+ call delete('XtestPopupWide')
+endfunc
+
+func Test_popupwin_sign()
+ CheckScreendump
+
+ let lines =<< trim END
+ call setline(1, range(10))
+ call sign_define('Current', {
+ \ 'text': '>>',
+ \ 'texthl': 'WarningMsg',
+ \ 'linehl': 'Error',
+ \ })
+ call sign_define('Other', {
+ \ 'text': '#!',
+ \ 'texthl': 'Error',
+ \ 'linehl': 'Search',
+ \ })
+ let winid = popup_create(['hello', 'bright', 'world'], {
+ \ 'minwidth': 20,
+ \ })
+ call setwinvar(winid, "&signcolumn", "yes")
+ let winbufnr = winbufnr(winid)
+
+ " add sign to current buffer, shows
+ call sign_place(1, 'Selected', 'Current', bufnr('%'), {'lnum': 1})
+ " add sign to current buffer, does not show
+ call sign_place(2, 'PopUpSelected', 'Other', bufnr('%'), {'lnum': 2})
+
+ " add sign to popup buffer, shows
+ call sign_place(3, 'PopUpSelected', 'Other', winbufnr, {'lnum': 1})
+ " add sign to popup buffer, does not show
+ call sign_place(4, 'Selected', 'Current', winbufnr, {'lnum': 2})
+ END
+ call writefile(lines, 'XtestPopupSign')
+
+ let buf = RunVimInTerminal('-S XtestPopupSign', #{rows: 10})
+ call VerifyScreenDump(buf, 'Test_popupwin_sign_1', {})
+
+ call StopVimInTerminal(buf)
+ call delete('XtestPopupSign')
+endfunc
+
" vim: shiftwidth=2 sts=2
diff --git a/src/version.c b/src/version.c
index 7bc97da6a2..d4e0861515 100644
--- a/src/version.c
+++ b/src/version.c
@@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2365,
+/**/
2364,
/**/
2363,