Mercurial > vim
diff src/testdir/test_popupwin.vim @ 16811:0457d49eb2d9 v8.1.1407
patch 8.1.1407: popup_create() does not support text properties
commit https://github.com/vim/vim/commit/7a8d0278bd6bd57e04f61183cb8e2969cf148e3f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 26 23:32:06 2019 +0200
patch 8.1.1407: popup_create() does not support text properties
Problem: Popup_create() does not support text properties.
Solution: Support the third form of the text argument.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 26 May 2019 23:45:05 +0200 |
parents | 5ff14f96f1c9 |
children | 069ee8dc8c8d |
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -14,6 +14,8 @@ func Test_simple_popup() \ "call setline(1, range(1, 100))", \ "hi PopupColor1 ctermbg=lightblue", \ "hi PopupColor2 ctermbg=lightcyan", + \ "hi Comment ctermfg=red", + \ "call prop_type_add('comment', {'highlight': 'Comment'})", \ "let winid = popup_create('hello there', {'line': 3, 'col': 11, 'highlight': 'PopupColor1'})", \ "let winid2 = popup_create(['another one', 'another two', 'another three'], {'line': 3, 'col': 25})", \ "call setwinvar(winid2, '&wincolor', 'PopupColor2')", @@ -23,7 +25,12 @@ func Test_simple_popup() " Add a tabpage call term_sendkeys(buf, ":tabnew\<CR>") - call term_sendkeys(buf, ":call popup_create('other tab', {'line': 4, 'col': 9})\<CR>") + call term_sendkeys(buf, ":call popup_create([" + \ .. "{'text': 'other tab'}," + \ .. "{'text': 'a comment line', 'props': [{" + \ .. "'col': 3, 'length': 7, 'type': 'comment'" + \ .. "}]}," + \ .. "], {'line': 4, 'col': 9})\<CR>") call VerifyScreenDump(buf, 'Test_popupwin_02', {}) " switch back to first tabpage