To: vim_dev@googlegroups.com Subject: Patch 8.1.2365 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2365 Problem: Missing tests for recent popupwin changes. Solution: Add test cases. Files: src/testdir/test_popupwin.vim *** ../vim-8.1.2364/src/testdir/test_popupwin.vim 2019-11-21 12:12:07.921993053 +0100 --- src/testdir/test_popupwin.vim 2019-11-30 14:08:03.767782138 +0100 *************** *** 3053,3056 **** --- 3053,3114 ---- 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 *** ../vim-8.1.2364/src/version.c 2019-11-30 15:34:05.134233382 +0100 --- src/version.c 2019-11-30 17:52:02.742611282 +0100 *************** *** 739,740 **** --- 739,742 ---- { /* Add new patch number below this line */ + /**/ + 2365, /**/ -- You are not really successful until someone claims he sat beside you in school. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///