To: vim_dev@googlegroups.com Subject: Patch 8.1.1683 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1683 Problem: Dictionary with string keys is longer than needed. Solution: Use *{key: val} for literaly keys. Files: runtime/doc/eval.txt, src/eval.c, src/dict.c, src/proto/dict.pro, src/testdir/test_listdict.vim, src/testdir/test_popupwin.vim, src/testdir/dumps/Test_popupwin_07.dump, src/testdir/dumps/Test_popupwin_mask_2.dump, src/testdir/dumps/Test_popupwin_mask_3.dump, src/testdir/dumps/Test_popupwin_mask_4.dump, src/testdir/dumps/Test_popupwin_mask_5.dump, src/testdir/dumps/Test_popupwin_scroll_2.dump, src/testdir/dumps/Test_popupwin_scroll_3.dump, src/testdir/dumps/Test_popupwin_scroll_4.dump *** ../vim-8.1.1682/runtime/doc/eval.txt 2019-07-13 21:18:51.464469580 +0200 --- runtime/doc/eval.txt 2019-07-13 22:39:40.659418070 +0200 *************** *** 58,64 **** Dictionary An associative, unordered array: Each entry has a key and a value. |Dictionary| ! Example: {'blue': "#0000ff", 'red': "#ff0000"} Funcref A reference to a function |Funcref|. Example: function("strlen") --- 58,66 ---- Dictionary An associative, unordered array: Each entry has a key and a value. |Dictionary| ! Examples: ! {'blue': "#0000ff", 'red': "#ff0000"} ! *{blue: "#0000ff", red: "#ff0000"} Funcref A reference to a function |Funcref|. Example: function("strlen") *************** *** 477,484 **** A key is always a String. You can use a Number, it will be converted to a String automatically. Thus the String '4' and the number 4 will find the same entry. Note that the String '04' and the Number 04 are different, since the ! Number will be converted to the String '4'. The empty string can be used as a ! key. A value can be any expression. Using a Dictionary for a value creates a nested Dictionary: > --- 479,492 ---- A key is always a String. You can use a Number, it will be converted to a String automatically. Thus the String '4' and the number 4 will find the same entry. Note that the String '04' and the Number 04 are different, since the ! Number will be converted to the String '4'. The empty string can also be used ! as a key. ! *literal-Dict* ! To avoid having to put quotes around every key the *{} form can be used. This ! does require the key to consist only of ASCII letters, digits, '-' and '_'. ! Example: > ! let mydict = *{zero: 0, one_key: 1, two-key: 2, 333: 3} ! Note that 333 here is the string "333". Empty keys are not possible here. A value can be any expression. Using a Dictionary for a value creates a nested Dictionary: > *** ../vim-8.1.1682/src/eval.c 2019-07-10 22:04:44.960086645 +0200 --- src/eval.c 2019-07-13 21:31:54.709398217 +0200 *************** *** 4391,4397 **** * $VAR environment variable * (expression) nested expression * [expr, expr] List ! * {key: val, key: val} Dictionary * * Also handle: * ! in front logical NOT --- 4391,4398 ---- * $VAR environment variable * (expression) nested expression * [expr, expr] List ! * {key: val, key: val} Dictionary ! * *{key: val, key: val} Dictionary with literal keys * * Also handle: * ! in front logical NOT *************** *** 4576,4587 **** break; /* * Lambda: {arg, arg -> expr} ! * Dictionary: {key: val, key: val} */ case '{': ret = get_lambda_tv(arg, rettv, evaluate); if (ret == NOTDONE) ! ret = dict_get_tv(arg, rettv, evaluate); break; /* --- 4577,4600 ---- break; /* + * Dictionary: *{key: val, key: val} + */ + case '*': if ((*arg)[1] == '{') + { + ++*arg; + ret = dict_get_tv(arg, rettv, evaluate, TRUE); + } + else + ret = NOTDONE; + break; + + /* * Lambda: {arg, arg -> expr} ! * Dictionary: {'key': val, 'key': val} */ case '{': ret = get_lambda_tv(arg, rettv, evaluate); if (ret == NOTDONE) ! ret = dict_get_tv(arg, rettv, evaluate, FALSE); break; /* *** ../vim-8.1.1682/src/dict.c 2019-06-22 01:40:38.169537422 +0200 --- src/dict.c 2019-07-13 22:11:16.607276273 +0200 *************** *** 709,719 **** } /* * Allocate a variable for a Dictionary and fill it from "*arg". * Return OK or FAIL. Returns NOTDONE for {expr}. */ int ! dict_get_tv(char_u **arg, typval_T *rettv, int evaluate) { dict_T *d = NULL; typval_T tvkey; --- 709,741 ---- } /* + * Get the key for *{key: val} into "tv" and advance "arg". + * Return FAIL when there is no valid key. + */ + static int + get_literal_key(char_u **arg, typval_T *tv) + { + char_u *p; + + if (!ASCII_ISALNUM(**arg) && **arg != '_' && **arg != '-') + return FAIL; + + for (p = *arg; ASCII_ISALNUM(*p) || *p == '_' || *p == '-'; ++p) + ; + tv->v_type = VAR_STRING; + tv->vval.v_string = vim_strnsave(*arg, (int)(p - *arg)); + + *arg = skipwhite(p); + return OK; + } + + /* * Allocate a variable for a Dictionary and fill it from "*arg". + * "literal" is TRUE for *{key: val} * Return OK or FAIL. Returns NOTDONE for {expr}. */ int ! dict_get_tv(char_u **arg, typval_T *rettv, int evaluate, int literal) { dict_T *d = NULL; typval_T tvkey; *************** *** 750,757 **** *arg = skipwhite(*arg + 1); while (**arg != '}' && **arg != NUL) { ! if (eval1(arg, &tvkey, evaluate) == FAIL) /* recursive! */ goto failret; if (**arg != ':') { semsg(_("E720: Missing colon in Dictionary: %s"), *arg); --- 772,782 ---- *arg = skipwhite(*arg + 1); while (**arg != '}' && **arg != NUL) { ! if ((literal ! ? get_literal_key(arg, &tvkey) ! : eval1(arg, &tvkey, evaluate)) == FAIL) // recursive! goto failret; + if (**arg != ':') { semsg(_("E720: Missing colon in Dictionary: %s"), *arg); *** ../vim-8.1.1682/src/proto/dict.pro 2019-06-16 22:54:10.649908500 +0200 --- src/proto/dict.pro 2019-07-13 21:37:22.780005279 +0200 *************** *** 28,34 **** varnumber_T dict_get_number(dict_T *d, char_u *key); varnumber_T dict_get_number_check(dict_T *d, char_u *key); char_u *dict2string(typval_T *tv, int copyID, int restore_copyID); ! int dict_get_tv(char_u **arg, typval_T *rettv, int evaluate); void dict_extend(dict_T *d1, dict_T *d2, char_u *action); dictitem_T *dict_lookup(hashitem_T *hi); int dict_equal(dict_T *d1, dict_T *d2, int ic, int recursive); --- 28,34 ---- varnumber_T dict_get_number(dict_T *d, char_u *key); varnumber_T dict_get_number_check(dict_T *d, char_u *key); char_u *dict2string(typval_T *tv, int copyID, int restore_copyID); ! int dict_get_tv(char_u **arg, typval_T *rettv, int evaluate, int literal); void dict_extend(dict_T *d1, dict_T *d2, char_u *action); dictitem_T *dict_lookup(hashitem_T *hi); int dict_equal(dict_T *d1, dict_T *d2, int ic, int recursive); *** ../vim-8.1.1682/src/testdir/test_listdict.vim 2019-02-25 05:56:04.444553044 +0100 --- src/testdir/test_listdict.vim 2019-07-13 21:30:26.493765009 +0200 *************** *** 280,285 **** --- 280,289 ---- call assert_equal(expected, d.func(string(remove(d, 'func')))) endfunc + func Test_dict_literal_keys() + call assert_equal({'one': 1, 'two2': 2, '3three': 3, '44': 4}, *{one: 1, two2: 2, 3three: 3, 44: 4},) + endfunc + " Nasty: deepcopy() dict that refers to itself (fails when noref used) func Test_dict_deepcopy() let d = {1:1, 2:2} *** ../vim-8.1.1682/src/testdir/test_popupwin.vim 2019-07-13 16:38:10.868413227 +0200 --- src/testdir/test_popupwin.vim 2019-07-13 22:35:13.232701293 +0200 *************** *** 14,36 **** 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, 'minwidth': 20, 'highlight': 'PopupColor1'}) ! let winid2 = popup_create(['another one', 'another two', 'another three'], {'line': 3, 'col': 25, 'minwidth': 20}) call setwinvar(winid2, '&wincolor', 'PopupColor2') END call writefile(lines, 'XtestPopup') ! let buf = RunVimInTerminal('-S XtestPopup', {'rows': 10}) call VerifyScreenDump(buf, 'Test_popupwin_01', {}) " Add a tabpage call term_sendkeys(buf, ":tabnew\") call term_sendkeys(buf, ":let popupwin = popup_create([" ! \ .. "{'text': 'other tab'}," ! \ .. "{'text': 'a comment line', 'props': [{" ! \ .. "'col': 3, 'length': 7, 'minwidth': 20, 'type': 'comment'" \ .. "}]}," ! \ .. "], {'line': 4, 'col': 9, 'minwidth': 20})\") call VerifyScreenDump(buf, 'Test_popupwin_02', {}) " switch back to first tabpage --- 14,36 ---- 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, minwidth: 20, highlight: 'PopupColor1'}) ! let winid2 = popup_create(['another one', 'another two', 'another three'], *{line: 3, col: 25, minwidth: 20}) call setwinvar(winid2, '&wincolor', 'PopupColor2') END call writefile(lines, 'XtestPopup') ! let buf = RunVimInTerminal('-S XtestPopup', *{rows: 10}) call VerifyScreenDump(buf, 'Test_popupwin_01', {}) " Add a tabpage call term_sendkeys(buf, ":tabnew\") call term_sendkeys(buf, ":let popupwin = popup_create([" ! \ .. "*{text: 'other tab'}," ! \ .. "*{text: 'a comment line', props: [*{" ! \ .. "col: 3, length: 7, minwidth: 20, type: 'comment'" \ .. "}]}," ! \ .. "], *{line: 4, col: 9, minwidth: 20})\") call VerifyScreenDump(buf, 'Test_popupwin_02', {}) " switch back to first tabpage *************** *** 48,54 **** call term_sendkeys(buf, ":let &columns = cols\") " resize popup, show empty line at bottom ! call term_sendkeys(buf, ":call popup_move(popupwin, {'minwidth': 15, 'maxwidth': 25, 'minheight': 3, 'maxheight': 5})\") call term_sendkeys(buf, ":redraw\") call VerifyScreenDump(buf, 'Test_popupwin_05', {}) --- 48,54 ---- call term_sendkeys(buf, ":let &columns = cols\") " resize popup, show empty line at bottom ! call term_sendkeys(buf, ":call popup_move(popupwin, *{minwidth: 15, maxwidth: 25, minheight: 3, maxheight: 5})\") call term_sendkeys(buf, ":redraw\") call VerifyScreenDump(buf, 'Test_popupwin_05', {}) *************** *** 59,65 **** " move popup over ruler call term_sendkeys(buf, ":set cmdheight=2\") ! call term_sendkeys(buf, ":call popup_move(popupwin, {'line': 7, 'col': 55})\") call VerifyScreenDump(buf, 'Test_popupwin_07', {}) " clear all popups after moving the cursor a bit, so that ruler is updated --- 59,65 ---- " move popup over ruler call term_sendkeys(buf, ":set cmdheight=2\") ! call term_sendkeys(buf, ":call popup_move(popupwin, *{line: 7, col: 55})\") call VerifyScreenDump(buf, 'Test_popupwin_07', {}) " clear all popups after moving the cursor a bit, so that ruler is updated *************** *** 83,99 **** for iter in range(0, 1) let lines =<< trim END call setline(1, range(1, 100)) ! call popup_create('hello border', {'line': 2, 'col': 3, 'border': []}) ! call popup_create('hello padding', {'line': 2, 'col': 23, 'padding': []}) ! call popup_create('hello both', {'line': 2, 'col': 43, 'border': [], 'padding': []}) ! call popup_create('border TL', {'line': 6, 'col': 3, 'border': [1, 0, 0, 4]}) ! call popup_create('paddings', {'line': 6, 'col': 23, 'padding': [1, 3, 2, 4]}) ! call popup_create('wrapped longer text', {'line': 8, 'col': 55, 'padding': [0, 3, 0, 3], 'border': [0, 1, 0, 1]}) ! call popup_create('right aligned text', {'line': 11, 'col': 56, 'wrap': 0, 'padding': [0, 3, 0, 3], 'border': [0, 1, 0, 1]}) END call insert(lines, iter == 1 ? '' : 'set enc=latin1') call writefile(lines, 'XtestPopupBorder') ! let buf = RunVimInTerminal('-S XtestPopupBorder', {'rows': 15}) call VerifyScreenDump(buf, 'Test_popupwin_2' .. iter, {}) call StopVimInTerminal(buf) --- 83,99 ---- for iter in range(0, 1) let lines =<< trim END call setline(1, range(1, 100)) ! call popup_create('hello border', *{line: 2, col: 3, border: []}) ! call popup_create('hello padding', *{line: 2, col: 23, padding: []}) ! call popup_create('hello both', *{line: 2, col: 43, border: [], padding: []}) ! call popup_create('border TL', *{line: 6, col: 3, border: [1, 0, 0, 4]}) ! call popup_create('paddings', *{line: 6, col: 23, padding: [1, 3, 2, 4]}) ! call popup_create('wrapped longer text', *{line: 8, col: 55, padding: [0, 3, 0, 3], border: [0, 1, 0, 1]}) ! call popup_create('right aligned text', *{line: 11, col: 56, wrap: 0, padding: [0, 3, 0, 3], border: [0, 1, 0, 1]}) END call insert(lines, iter == 1 ? '' : 'set enc=latin1') call writefile(lines, 'XtestPopupBorder') ! let buf = RunVimInTerminal('-S XtestPopupBorder', *{rows: 15}) call VerifyScreenDump(buf, 'Test_popupwin_2' .. iter, {}) call StopVimInTerminal(buf) *************** *** 107,128 **** hi RightColor ctermbg=245 hi BottomColor ctermbg=240 hi LeftColor ctermbg=248 ! call popup_create('hello border', {'line': 2, 'col': 3, 'border': [], 'borderhighlight': ['BlueColor']}) ! call popup_create(['hello border', 'and more'], {'line': 2, 'col': 23, 'border': [], 'borderhighlight': ['TopColor', 'RightColor', 'BottomColor', 'LeftColor']}) ! call popup_create(['hello border', 'lines only'], {'line': 2, 'col': 43, 'border': [], 'borderhighlight': ['BlueColor'], 'borderchars': ['x']}) ! call popup_create(['hello border', 'with corners'], {'line': 2, 'col': 60, 'border': [], 'borderhighlight': ['BlueColor'], 'borderchars': ['x', '#']}) ! let winid = popup_create(['hello border', 'with numbers'], {'line': 6, 'col': 3, 'border': [], 'borderhighlight': ['BlueColor'], 'borderchars': ['0', '1', '2', '3', '4', '5', '6', '7']}) ! call popup_create(['hello border', 'just blanks'], {'line': 7, 'col': 23, 'border': [], 'borderhighlight': ['BlueColor'], 'borderchars': [' ']}) func MultiByte() ! call popup_create(['hello'], {'line': 8, 'col': 43, 'border': [], 'borderchars': ['─', '│', '─', '│', '┌', '┐', '┘', '└']}) endfunc END call writefile(lines, 'XtestPopupBorder') ! let buf = RunVimInTerminal('-S XtestPopupBorder', {'rows': 12}) call VerifyScreenDump(buf, 'Test_popupwin_22', {}) " check that changing borderchars triggers a redraw ! call term_sendkeys(buf, ":call popup_setoptions(winid, {'borderchars': ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']})\") call VerifyScreenDump(buf, 'Test_popupwin_23', {}) " check multi-byte border only with 'ambiwidth' single --- 107,128 ---- hi RightColor ctermbg=245 hi BottomColor ctermbg=240 hi LeftColor ctermbg=248 ! call popup_create('hello border', *{line: 2, col: 3, border: [], borderhighlight: ['BlueColor']}) ! call popup_create(['hello border', 'and more'], *{line: 2, col: 23, border: [], borderhighlight: ['TopColor', 'RightColor', 'BottomColor', 'LeftColor']}) ! call popup_create(['hello border', 'lines only'], *{line: 2, col: 43, border: [], borderhighlight: ['BlueColor'], borderchars: ['x']}) ! call popup_create(['hello border', 'with corners'], *{line: 2, col: 60, border: [], borderhighlight: ['BlueColor'], borderchars: ['x', '#']}) ! let winid = popup_create(['hello border', 'with numbers'], *{line: 6, col: 3, border: [], borderhighlight: ['BlueColor'], borderchars: ['0', '1', '2', '3', '4', '5', '6', '7']}) ! call popup_create(['hello border', 'just blanks'], *{line: 7, col: 23, border: [], borderhighlight: ['BlueColor'], borderchars: [' ']}) func MultiByte() ! call popup_create(['hello'], *{line: 8, col: 43, border: [], borderchars: ['─', '│', '─', '│', '┌', '┐', '┘', '└']}) endfunc END call writefile(lines, 'XtestPopupBorder') ! let buf = RunVimInTerminal('-S XtestPopupBorder', *{rows: 12}) call VerifyScreenDump(buf, 'Test_popupwin_22', {}) " check that changing borderchars triggers a redraw ! call term_sendkeys(buf, ":call popup_setoptions(winid, *{borderchars: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']})\") call VerifyScreenDump(buf, 'Test_popupwin_23', {}) " check multi-byte border only with 'ambiwidth' single *************** *** 134,158 **** call StopVimInTerminal(buf) call delete('XtestPopupBorder') ! let with_border_or_padding = { ! \ 'line': 2, ! \ 'core_line': 3, ! \ 'col': 3, ! \ 'core_col': 4, ! \ 'width': 14, ! \ 'core_width': 12, ! \ 'height': 3, ! \ 'core_height': 1, ! \ 'firstline': 1, ! \ 'scrollbar': 0, ! \ 'visible': 1} ! let winid = popup_create('hello border', {'line': 2, 'col': 3, 'border': []})", call assert_equal(with_border_or_padding, popup_getpos(winid)) let options = popup_getoptions(winid) call assert_equal([], options.border) call assert_false(has_key(options, "padding")) ! let winid = popup_create('hello padding', {'line': 2, 'col': 3, 'padding': []}) let with_border_or_padding.width = 15 let with_border_or_padding.core_width = 13 call assert_equal(with_border_or_padding, popup_getpos(winid)) --- 134,158 ---- call StopVimInTerminal(buf) call delete('XtestPopupBorder') ! let with_border_or_padding = *{ ! \ line: 2, ! \ core_line: 3, ! \ col: 3, ! \ core_col: 4, ! \ width: 14, ! \ core_width: 12, ! \ height: 3, ! \ core_height: 1, ! \ firstline: 1, ! \ scrollbar: 0, ! \ visible: 1} ! let winid = popup_create('hello border', *{line: 2, col: 3, border: []})", call assert_equal(with_border_or_padding, popup_getpos(winid)) let options = popup_getoptions(winid) call assert_equal([], options.border) call assert_false(has_key(options, "padding")) ! let winid = popup_create('hello padding', *{line: 2, col: 3, padding: []}) let with_border_or_padding.width = 15 let with_border_or_padding.core_width = 13 call assert_equal(with_border_or_padding, popup_getpos(winid)) *************** *** 160,170 **** call assert_false(has_key(options, "border")) call assert_equal([], options.padding) ! call popup_setoptions(winid, { ! \ 'padding': [1, 2, 3, 4], ! \ 'border': [4, 0, 7, 8], ! \ 'borderhighlight': ['Top', 'Right', 'Bottom', 'Left'], ! \ 'borderchars': ['1', '^', '2', '>', '3', 'v', '4', '<'], \ }) let options = popup_getoptions(winid) call assert_equal([1, 0, 1, 1], options.border) --- 160,170 ---- call assert_false(has_key(options, "border")) call assert_equal([], options.padding) ! call popup_setoptions(winid, *{ ! \ padding: [1, 2, 3, 4], ! \ border: [4, 0, 7, 8], ! \ borderhighlight: ['Top', 'Right', 'Bottom', 'Left'], ! \ borderchars: ['1', '^', '2', '>', '3', 'v', '4', '<'], \ }) let options = popup_getoptions(winid) call assert_equal([1, 0, 1, 1], options.border) *************** *** 172,190 **** call assert_equal(['Top', 'Right', 'Bottom', 'Left'], options.borderhighlight) call assert_equal(['1', '^', '2', '>', '3', 'v', '4', '<'], options.borderchars) ! let winid = popup_create('hello both', {'line': 3, 'col': 8, 'border': [], 'padding': []}) ! call assert_equal({ ! \ 'line': 3, ! \ 'core_line': 5, ! \ 'col': 8, ! \ 'core_col': 10, ! \ 'width': 14, ! \ 'core_width': 10, ! \ 'height': 5, ! \ 'scrollbar': 0, ! \ 'core_height': 1, ! \ 'firstline': 1, ! \ 'visible': 1}, popup_getpos(winid)) call popup_clear() endfunc --- 172,190 ---- call assert_equal(['Top', 'Right', 'Bottom', 'Left'], options.borderhighlight) call assert_equal(['1', '^', '2', '>', '3', 'v', '4', '<'], options.borderchars) ! let winid = popup_create('hello both', *{line: 3, col: 8, border: [], padding: []}) ! call assert_equal(*{ ! \ line: 3, ! \ core_line: 5, ! \ col: 8, ! \ core_col: 10, ! \ width: 14, ! \ core_width: 10, ! \ height: 5, ! \ scrollbar: 0, ! \ core_height: 1, ! \ firstline: 1, ! \ visible: 1}, popup_getpos(winid)) call popup_clear() endfunc *************** *** 202,212 **** \ '{', \ ' printf(123);', \ '}', ! \], {'line': 3, 'col': 25, 'highlight': 'PopupColor'}) call win_execute(winid, 'set syntax=cpp') END call writefile(lines, 'XtestPopup') ! let buf = RunVimInTerminal('-S XtestPopup', {'rows': 10}) call VerifyScreenDump(buf, 'Test_popupwin_10', {}) " clean up --- 202,212 ---- \ '{', \ ' printf(123);', \ '}', ! \], *{line: 3, col: 25, highlight: 'PopupColor'}) call win_execute(winid, 'set syntax=cpp') END call writefile(lines, 'XtestPopup') ! let buf = RunVimInTerminal('-S XtestPopup', *{rows: 10}) call VerifyScreenDump(buf, 'Test_popupwin_10', {}) " clean up *************** *** 227,237 **** \ '{', \ "\tprintf(567);", \ '}', ! \], {'line': 3, 'col': 21, 'highlight': 'PopupColor'}) call setbufvar(winbufnr(winid), '&syntax', 'cpp') END call writefile(lines, 'XtestPopup') ! let buf = RunVimInTerminal('-S XtestPopup', {'rows': 10}) call VerifyScreenDump(buf, 'Test_popupwin_11', {}) " clean up --- 227,237 ---- \ '{', \ "\tprintf(567);", \ '}', ! \], *{line: 3, col: 21, highlight: 'PopupColor'}) call setbufvar(winbufnr(winid), '&syntax', 'cpp') END call writefile(lines, 'XtestPopup') ! let buf = RunVimInTerminal('-S XtestPopup', *{rows: 10}) call VerifyScreenDump(buf, 'Test_popupwin_11', {}) " clean up *************** *** 248,254 **** let winid = popup_create([ \ '111 222 333', \ '444 555 666', ! \], {'line': 3, 'col': 10, 'border': []}) set hlsearch /666 call matchadd('ErrorMsg', '111') --- 248,254 ---- let winid = popup_create([ \ '111 222 333', \ '444 555 666', ! \], *{line: 3, col: 10, border: []}) set hlsearch /666 call matchadd('ErrorMsg', '111') *************** *** 257,263 **** call win_execute(winid, "call matchadd('ErrorMsg', '555')") END call writefile(lines, 'XtestPopupMatches') ! let buf = RunVimInTerminal('-S XtestPopupMatches', {'rows': 10}) call VerifyScreenDump(buf, 'Test_popupwin_matches', {}) " clean up --- 257,263 ---- call win_execute(winid, "call matchadd('ErrorMsg', '555')") END call writefile(lines, 'XtestPopupMatches') ! let buf = RunVimInTerminal('-S XtestPopupMatches', *{rows: 10}) call VerifyScreenDump(buf, 'Test_popupwin_matches', {}) " clean up *************** *** 273,312 **** call setline(1, repeat([repeat('-', 60)], 15)) set so=0 normal 2G3|r# ! let winid1 = popup_create(['first', 'second'], { ! \ 'line': 'cursor+1', ! \ 'col': 'cursor', ! \ 'pos': 'topleft', ! \ 'border': [], ! \ 'padding': [], \ }) normal 25|r@ ! let winid1 = popup_create(['First', 'SeconD'], { ! \ 'line': 'cursor+1', ! \ 'col': 'cursor', ! \ 'pos': 'topright', ! \ 'border': [], ! \ 'padding': [], \ }) normal 9G29|r% ! let winid1 = popup_create(['fiRSt', 'seCOnd'], { ! \ 'line': 'cursor-1', ! \ 'col': 'cursor', ! \ 'pos': 'botleft', ! \ 'border': [], ! \ 'padding': [], \ }) normal 51|r& ! let winid1 = popup_create(['FIrsT', 'SEcoND'], { ! \ 'line': 'cursor-1', ! \ 'col': 'cursor', ! \ 'pos': 'botright', ! \ 'border': [], ! \ 'padding': [], \ }) END call writefile(lines, 'XtestPopupCorners') ! let buf = RunVimInTerminal('-S XtestPopupCorners', {'rows': 12}) call VerifyScreenDump(buf, 'Test_popupwin_corners', {}) " clean up --- 273,312 ---- call setline(1, repeat([repeat('-', 60)], 15)) set so=0 normal 2G3|r# ! let winid1 = popup_create(['first', 'second'], *{ ! \ line: 'cursor+1', ! \ col: 'cursor', ! \ pos: 'topleft', ! \ border: [], ! \ padding: [], \ }) normal 25|r@ ! let winid1 = popup_create(['First', 'SeconD'], *{ ! \ line: 'cursor+1', ! \ col: 'cursor', ! \ pos: 'topright', ! \ border: [], ! \ padding: [], \ }) normal 9G29|r% ! let winid1 = popup_create(['fiRSt', 'seCOnd'], *{ ! \ line: 'cursor-1', ! \ col: 'cursor', ! \ pos: 'botleft', ! \ border: [], ! \ padding: [], \ }) normal 51|r& ! let winid1 = popup_create(['FIrsT', 'SEcoND'], *{ ! \ line: 'cursor-1', ! \ col: 'cursor', ! \ pos: 'botright', ! \ border: [], ! \ padding: [], \ }) END call writefile(lines, 'XtestPopupCorners') ! let buf = RunVimInTerminal('-S XtestPopupCorners', *{rows: 12}) call VerifyScreenDump(buf, 'Test_popupwin_corners', {}) " clean up *************** *** 320,344 **** endif let lines =<< trim END call setline(1, range(1, 20)) ! call popup_create(['1111', '222222', '33333', '44', '5', '666666', '77777', '888', '9999999999999999'], { ! \ 'maxheight': 4, ! \ 'firstline': 3, \ }) END call writefile(lines, 'XtestPopupFirstline') ! let buf = RunVimInTerminal('-S XtestPopupFirstline', {'rows': 10}) call VerifyScreenDump(buf, 'Test_popupwin_firstline', {}) " clean up call StopVimInTerminal(buf) call delete('XtestPopupFirstline') ! let winid = popup_create(['1111', '222222', '33333', '44444'], { ! \ 'maxheight': 2, ! \ 'firstline': 3, \ }) call assert_equal(3, popup_getoptions(winid).firstline) ! call popup_setoptions(winid, {'firstline': 1}) call assert_equal(1, popup_getoptions(winid).firstline) call popup_close(winid) --- 320,344 ---- endif let lines =<< trim END call setline(1, range(1, 20)) ! call popup_create(['1111', '222222', '33333', '44', '5', '666666', '77777', '888', '9999999999999999'], *{ ! \ maxheight: 4, ! \ firstline: 3, \ }) END call writefile(lines, 'XtestPopupFirstline') ! let buf = RunVimInTerminal('-S XtestPopupFirstline', *{rows: 10}) call VerifyScreenDump(buf, 'Test_popupwin_firstline', {}) " clean up call StopVimInTerminal(buf) call delete('XtestPopupFirstline') ! let winid = popup_create(['1111', '222222', '33333', '44444'], *{ ! \ maxheight: 2, ! \ firstline: 3, \ }) call assert_equal(3, popup_getoptions(winid).firstline) ! call popup_setoptions(winid, *{firstline: 1}) call assert_equal(1, popup_getoptions(winid).firstline) call popup_close(winid) *************** *** 351,360 **** " create a popup that covers the command line let lines =<< trim END call setline(1, range(1, 20)) ! let winid = popup_create(['1111', '222222', '33333'], { ! \ 'drag': 1, ! \ 'border': [], ! \ 'line': &lines - 4, \ }) func Dragit() call feedkeys("\\\\\", "xt") --- 351,360 ---- " create a popup that covers the command line let lines =<< trim END call setline(1, range(1, 20)) ! let winid = popup_create(['1111', '222222', '33333'], *{ ! \ drag: 1, ! \ border: [], ! \ line: &lines - 4, \ }) func Dragit() call feedkeys("\\\\\", "xt") *************** *** 363,369 **** map :call test_setmouse(&lines - 8, &columns / 2) END call writefile(lines, 'XtestPopupDrag') ! let buf = RunVimInTerminal('-S XtestPopupDrag', {'rows': 10}) call VerifyScreenDump(buf, 'Test_popupwin_drag_01', {}) call term_sendkeys(buf, ":call Dragit()\") --- 363,369 ---- map :call test_setmouse(&lines - 8, &columns / 2) END call writefile(lines, 'XtestPopupDrag') ! let buf = RunVimInTerminal('-S XtestPopupDrag', *{rows: 10}) call VerifyScreenDump(buf, 'Test_popupwin_drag_01', {}) call term_sendkeys(buf, ":call Dragit()\") *************** *** 381,411 **** let lines =<< trim END call setline(1, range(1, 20)) " With border, can click on X ! let winid = popup_create('foobar', { ! \ 'close': 'button', ! \ 'border': [], ! \ 'line': 1, ! \ 'col': 1, \ }) func CloseMsg(id, result) echomsg 'Popup closed with ' .. a:result endfunc ! let winid = popup_create('notification', { ! \ 'close': 'click', ! \ 'line': 3, ! \ 'col': 15, ! \ 'callback': 'CloseMsg', \ }) ! let winid = popup_create('no border here', { ! \ 'close': 'button', ! \ 'line': 5, ! \ 'col': 3, \ }) ! let winid = popup_create('only padding', { ! \ 'close': 'button', ! \ 'padding': [], ! \ 'line': 5, ! \ 'col': 23, \ }) func CloseWithX() call feedkeys("\\\", "xt") --- 381,411 ---- let lines =<< trim END call setline(1, range(1, 20)) " With border, can click on X ! let winid = popup_create('foobar', *{ ! \ close: 'button', ! \ border: [], ! \ line: 1, ! \ col: 1, \ }) func CloseMsg(id, result) echomsg 'Popup closed with ' .. a:result endfunc ! let winid = popup_create('notification', *{ ! \ close: 'click', ! \ line: 3, ! \ col: 15, ! \ callback: 'CloseMsg', \ }) ! let winid = popup_create('no border here', *{ ! \ close: 'button', ! \ line: 5, ! \ col: 3, \ }) ! let winid = popup_create('only padding', *{ ! \ close: 'button', ! \ padding: [], ! \ line: 5, ! \ col: 23, \ }) func CloseWithX() call feedkeys("\\\", "xt") *************** *** 417,423 **** map :call test_setmouse(3, 17) END call writefile(lines, 'XtestPopupClose') ! let buf = RunVimInTerminal('-S XtestPopupClose', {'rows': 10}) call VerifyScreenDump(buf, 'Test_popupwin_close_01', {}) call term_sendkeys(buf, ":call CloseWithX()\") --- 417,423 ---- map :call test_setmouse(3, 17) END call writefile(lines, 'XtestPopupClose') ! let buf = RunVimInTerminal('-S XtestPopupClose', *{rows: 10}) call VerifyScreenDump(buf, 'Test_popupwin_close_01', {}) call term_sendkeys(buf, ":call CloseWithX()\") *************** *** 441,493 **** let winid = popup_create([ \ 'some text', \ 'another line', ! \], { ! \ 'line': 1, ! \ 'col': 10, ! \ 'wrap': 0, ! \ 'fixed': 1, ! \ 'zindex': 90, ! \ 'padding': [], ! \ 'highlight': 'PopupColor', ! \ 'mask': [[1,1,1,1], [-5,-1,4,4], [7,9,2,3], [2,4,3,3]]}) call popup_create([ \ 'xxxxxxxxx', \ 'yyyyyyyyy', ! \], { ! \ 'line': 3, ! \ 'col': 18, ! \ 'zindex': 20}) let winidb = popup_create([ \ 'just one line', ! \], { ! \ 'line': 7, ! \ 'col': 10, ! \ 'wrap': 0, ! \ 'fixed': 1, ! \ 'close': 'button', ! \ 'zindex': 90, ! \ 'padding': [], ! \ 'border': [], ! \ 'mask': [[1,2,1,1], [-5,-1,4,4], [7,9,2,3], [3,5,5,5],[-7,-4,5,5]]}) END call writefile(lines, 'XtestPopupMask') ! let buf = RunVimInTerminal('-S XtestPopupMask', {'rows': 13}) call VerifyScreenDump(buf, 'Test_popupwin_mask_1', {}) ! call term_sendkeys(buf, ":call popup_move(winid, {'col': 11, 'line': 2})\") ! call term_sendkeys(buf, ":call popup_move(winidb, {'col': 12})\") call VerifyScreenDump(buf, 'Test_popupwin_mask_2', {}) ! call term_sendkeys(buf, ":call popup_move(winid, {'col': 65, 'line': 2})\") ! call term_sendkeys(buf, ":call popup_move(winidb, {'col': 63})\") call VerifyScreenDump(buf, 'Test_popupwin_mask_3', {}) ! call term_sendkeys(buf, ":call popup_move(winid, {'pos': 'topright', 'col': 12, 'line': 2})\") ! call term_sendkeys(buf, ":call popup_move(winidb, {'pos': 'topright', 'col': 12})\") call VerifyScreenDump(buf, 'Test_popupwin_mask_4', {}) ! call term_sendkeys(buf, ":call popup_move(winid, {'pos': 'topright', 'col': 12, 'line': 11})\") ! call term_sendkeys(buf, ":call popup_move(winidb, {'pos': 'topleft', 'col': 42, 'line': 11})\") call VerifyScreenDump(buf, 'Test_popupwin_mask_5', {}) " clean up --- 441,493 ---- let winid = popup_create([ \ 'some text', \ 'another line', ! \], *{ ! \ line: 1, ! \ col: 10, ! \ wrap: 0, ! \ fixed: 1, ! \ zindex: 90, ! \ padding: [], ! \ highlight: 'PopupColor', ! \ mask: [[1,1,1,1], [-5,-1,4,4], [7,9,2,3], [2,4,3,3]]}) call popup_create([ \ 'xxxxxxxxx', \ 'yyyyyyyyy', ! \], *{ ! \ line: 3, ! \ col: 18, ! \ zindex: 20}) let winidb = popup_create([ \ 'just one line', ! \], *{ ! \ line: 7, ! \ col: 10, ! \ wrap: 0, ! \ fixed: 1, ! \ close: 'button', ! \ zindex: 90, ! \ padding: [], ! \ border: [], ! \ mask: [[1,2,1,1], [-5,-1,4,4], [7,9,2,3], [3,5,5,5],[-7,-4,5,5]]}) END call writefile(lines, 'XtestPopupMask') ! let buf = RunVimInTerminal('-S XtestPopupMask', *{rows: 13}) call VerifyScreenDump(buf, 'Test_popupwin_mask_1', {}) ! call term_sendkeys(buf, ":call popup_move(winid, *{col: 11, line: 2})\") ! call term_sendkeys(buf, ":call popup_move(winidb, *{col: 12})\") call VerifyScreenDump(buf, 'Test_popupwin_mask_2', {}) ! call term_sendkeys(buf, ":call popup_move(winid, *{col: 65, line: 2})\") ! call term_sendkeys(buf, ":call popup_move(winidb, *{col: 63})\") call VerifyScreenDump(buf, 'Test_popupwin_mask_3', {}) ! call term_sendkeys(buf, ":call popup_move(winid, *{pos: 'topright', col: 12, line: 2})\") ! call term_sendkeys(buf, ":call popup_move(winidb, *{pos: 'topright', col: 12})\") call VerifyScreenDump(buf, 'Test_popupwin_mask_4', {}) ! call term_sendkeys(buf, ":call popup_move(winid, *{pos: 'topright', col: 12, line: 11})\") ! call term_sendkeys(buf, ":call popup_move(winidb, *{pos: 'topleft', col: 42, line: 11})\") call VerifyScreenDump(buf, 'Test_popupwin_mask_5', {}) " clean up *************** *** 506,516 **** let lines =<< trim END set clipboard=autoselect call setline(1, range(1, 20)) ! let winid = popup_create(['the word', 'some more', 'several words here'], { ! \ 'drag': 1, ! \ 'border': [], ! \ 'line': 3, ! \ 'col': 10, \ }) func Select1() call feedkeys("\\\\\", "xt") --- 506,516 ---- let lines =<< trim END set clipboard=autoselect call setline(1, range(1, 20)) ! let winid = popup_create(['the word', 'some more', 'several words here'], *{ ! \ drag: 1, ! \ border: [], ! \ line: 3, ! \ col: 10, \ }) func Select1() call feedkeys("\\\\\", "xt") *************** *** 519,525 **** map :call test_setmouse(6, 23) END call writefile(lines, 'XtestPopupSelect') ! let buf = RunVimInTerminal('-S XtestPopupSelect', {'rows': 10}) call term_sendkeys(buf, ":call Select1()\") call VerifyScreenDump(buf, 'Test_popupwin_select_01', {}) --- 519,525 ---- map :call test_setmouse(6, 23) END call writefile(lines, 'XtestPopupSelect') ! let buf = RunVimInTerminal('-S XtestPopupSelect', *{rows: 10}) call term_sendkeys(buf, ":call Select1()\") call VerifyScreenDump(buf, 'Test_popupwin_select_01', {}) *************** *** 553,559 **** call assert_equal(0, bufexists(bufnr)) " global popup is visible in any tab ! let winid = popup_create("text", {'tabpage': -1}) call assert_equal(1, popup_getpos(winid).visible) call assert_equal(-1, popup_getoptions(winid).tabpage) tabnew --- 553,559 ---- call assert_equal(0, bufexists(bufnr)) " global popup is visible in any tab ! let winid = popup_create("text", *{tabpage: -1}) call assert_equal(1, popup_getpos(winid).visible) call assert_equal(-1, popup_getoptions(winid).tabpage) tabnew *************** *** 565,571 **** " create popup in other tab tabnew ! let winid = popup_create("text", {'tabpage': 1}) call assert_equal(0, popup_getpos(winid).visible) call assert_equal(1, popup_getoptions(winid).tabpage) quit --- 565,571 ---- " create popup in other tab tabnew ! let winid = popup_create("text", *{tabpage: 1}) call assert_equal(0, popup_getpos(winid).visible) call assert_equal(1, popup_getoptions(winid).tabpage) quit *************** *** 576,594 **** func Test_popup_valid_arguments() " Zero value is like the property wasn't there ! let winid = popup_create("text", {"col": 0}) let pos = popup_getpos(winid) call assert_inrange(&columns / 2 - 1, &columns / 2 + 1, pos.col) call popup_clear() " using cursor column has minimum value of 1 ! let winid = popup_create("text", {"col": 'cursor-100'}) let pos = popup_getpos(winid) call assert_equal(1, pos.col) call popup_clear() " center ! let winid = popup_create("text", {"pos": 'center'}) let pos = popup_getpos(winid) let around = (&columns - pos.width) / 2 call assert_inrange(around - 1, around + 1, pos.col) --- 576,594 ---- func Test_popup_valid_arguments() " Zero value is like the property wasn't there ! let winid = popup_create("text", *{col: 0}) let pos = popup_getpos(winid) call assert_inrange(&columns / 2 - 1, &columns / 2 + 1, pos.col) call popup_clear() " using cursor column has minimum value of 1 ! let winid = popup_create("text", *{col: 'cursor-100'}) let pos = popup_getpos(winid) call assert_equal(1, pos.col) call popup_clear() " center ! let winid = popup_create("text", *{pos: 'center'}) let pos = popup_getpos(winid) let around = (&columns - pos.width) / 2 call assert_inrange(around - 1, around + 1, pos.col) *************** *** 603,642 **** call assert_fails('call popup_create("text", "none")', 'E715:') call popup_clear() ! call assert_fails('call popup_create("text", {"col": "xxx"})', 'E475:') call popup_clear() ! call assert_fails('call popup_create("text", {"col": "cursor8"})', 'E15:') call popup_clear() ! call assert_fails('call popup_create("text", {"col": "cursor+x"})', 'E15:') call popup_clear() ! call assert_fails('call popup_create("text", {"col": "cursor+8x"})', 'E15:') call popup_clear() ! call assert_fails('call popup_create("text", {"line": "xxx"})', 'E475:') call popup_clear() ! call assert_fails('call popup_create("text", {"line": "cursor8"})', 'E15:') call popup_clear() ! call assert_fails('call popup_create("text", {"line": "cursor+x"})', 'E15:') call popup_clear() ! call assert_fails('call popup_create("text", {"line": "cursor+8x"})', 'E15:') call popup_clear() ! call assert_fails('call popup_create("text", {"pos": "there"})', 'E475:') call popup_clear() ! call assert_fails('call popup_create("text", {"padding": "none"})', 'E714:') call popup_clear() ! call assert_fails('call popup_create("text", {"border": "none"})', 'E714:') call popup_clear() ! call assert_fails('call popup_create("text", {"borderhighlight": "none"})', 'E714:') call popup_clear() ! call assert_fails('call popup_create("text", {"borderchars": "none"})', 'E714:') call popup_clear() ! call assert_fails('call popup_create([{"text": "text"}, 666], {})', 'E715:') call popup_clear() ! call assert_fails('call popup_create([{"text": "text", "props": "none"}], {})', 'E714:') call popup_clear() ! call assert_fails('call popup_create([{"text": "text", "props": ["none"]}], {})', 'E715:') call popup_clear() endfunc --- 603,642 ---- call assert_fails('call popup_create("text", "none")', 'E715:') call popup_clear() ! call assert_fails('call popup_create("text", *{col: "xxx"})', 'E475:') call popup_clear() ! call assert_fails('call popup_create("text", *{col: "cursor8"})', 'E15:') call popup_clear() ! call assert_fails('call popup_create("text", *{col: "cursor+x"})', 'E15:') call popup_clear() ! call assert_fails('call popup_create("text", *{col: "cursor+8x"})', 'E15:') call popup_clear() ! call assert_fails('call popup_create("text", *{line: "xxx"})', 'E475:') call popup_clear() ! call assert_fails('call popup_create("text", *{line: "cursor8"})', 'E15:') call popup_clear() ! call assert_fails('call popup_create("text", *{line: "cursor+x"})', 'E15:') call popup_clear() ! call assert_fails('call popup_create("text", *{line: "cursor+8x"})', 'E15:') call popup_clear() ! call assert_fails('call popup_create("text", *{pos: "there"})', 'E475:') call popup_clear() ! call assert_fails('call popup_create("text", *{padding: "none"})', 'E714:') call popup_clear() ! call assert_fails('call popup_create("text", *{border: "none"})', 'E714:') call popup_clear() ! call assert_fails('call popup_create("text", *{borderhighlight: "none"})', 'E714:') call popup_clear() ! call assert_fails('call popup_create("text", *{borderchars: "none"})', 'E714:') call popup_clear() ! call assert_fails('call popup_create([*{text: "text"}, 666], {})', 'E715:') call popup_clear() ! call assert_fails('call popup_create([*{text: "text", props: "none"}], {})', 'E714:') call popup_clear() ! call assert_fails('call popup_create([*{text: "text", props: ["none"]}], {})', 'E715:') call popup_clear() endfunc *************** *** 676,685 **** call setline(1, range(1, 100)) let winid = popup_create( \ 'a long line that wont fit', ! \ {'line': 3, 'col': 20, 'maxwidth': 10, 'wrap': 1}) END call writefile(lines, 'XtestPopup') ! let buf = RunVimInTerminal('-S XtestPopup', {'rows': 10}) call VerifyScreenDump(buf, 'Test_popupwin_wrap', {}) " clean up --- 676,685 ---- call setline(1, range(1, 100)) let winid = popup_create( \ 'a long line that wont fit', ! \ *{line: 3, col: 20, maxwidth: 10, wrap: 1}) END call writefile(lines, 'XtestPopup') ! let buf = RunVimInTerminal('-S XtestPopup', *{rows: 10}) call VerifyScreenDump(buf, 'Test_popupwin_wrap', {}) " clean up *************** *** 695,704 **** call setline(1, range(1, 100)) let winid = popup_create( \ 'a long line that wont fit', ! \ {'line': 3, 'col': 20, 'maxwidth': 10, 'wrap': 0}) END call writefile(lines, 'XtestPopup') ! let buf = RunVimInTerminal('-S XtestPopup', {'rows': 10}) call VerifyScreenDump(buf, 'Test_popupwin_nowrap', {}) " clean up --- 695,704 ---- call setline(1, range(1, 100)) let winid = popup_create( \ 'a long line that wont fit', ! \ *{line: 3, col: 20, maxwidth: 10, wrap: 0}) END call writefile(lines, 'XtestPopup') ! let buf = RunVimInTerminal('-S XtestPopup', *{rows: 10}) call VerifyScreenDump(buf, 'Test_popupwin_nowrap', {}) " clean up *************** *** 713,723 **** topleft vnew call setline(1, 'hello') ! let winid = popup_create('world', { ! \ 'line': 1, ! \ 'col': 1, ! \ 'minwidth': 20, ! \ 'time': 500, \}) redraw let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '') --- 713,723 ---- topleft vnew call setline(1, 'hello') ! let winid = popup_create('world', *{ ! \ line: 1, ! \ col: 1, ! \ minwidth: 20, ! \ time: 500, \}) redraw let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '') *************** *** 733,743 **** let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '') call assert_equal('hello', line) ! call popup_create('on the command line', { ! \ 'line': &lines, ! \ 'col': 10, ! \ 'minwidth': 20, ! \ 'time': 500, \}) redraw let line = join(map(range(1, 30), 'screenstring(&lines, v:val)'), '') --- 733,743 ---- let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '') call assert_equal('hello', line) ! call popup_create('on the command line', *{ ! \ line: &lines, ! \ col: 10, ! \ minwidth: 20, ! \ time: 500, \}) redraw let line = join(map(range(1, 30), 'screenstring(&lines, v:val)'), '') *************** *** 755,764 **** topleft vnew call setline(1, 'hello') ! let winid = popup_create('world', { ! \ 'line': 1, ! \ 'col': 1, ! \ 'minwidth': 20, \}) redraw let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '') --- 755,764 ---- topleft vnew call setline(1, 'hello') ! let winid = popup_create('world', *{ ! \ line: 1, ! \ col: 1, ! \ minwidth: 20, \}) redraw let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '') *************** *** 801,823 **** topleft vnew call setline(1, 'hello') ! let winid = popup_create('world', { ! \ 'line': 1, ! \ 'col': 1, ! \ 'minwidth': 20, \}) redraw let line = join(map(range(1, 6), 'screenstring(1, v:val)'), '') call assert_equal('world ', line) ! call popup_move(winid, {'line': 2, 'col': 2}) redraw let line = join(map(range(1, 6), 'screenstring(1, v:val)'), '') call assert_equal('hello ', line) let line = join(map(range(1, 6), 'screenstring(2, v:val)'), '') call assert_equal('~world', line) ! call popup_move(winid, {'line': 1}) redraw let line = join(map(range(1, 6), 'screenstring(1, v:val)'), '') call assert_equal('hworld', line) --- 801,823 ---- topleft vnew call setline(1, 'hello') ! let winid = popup_create('world', *{ ! \ line: 1, ! \ col: 1, ! \ minwidth: 20, \}) redraw let line = join(map(range(1, 6), 'screenstring(1, v:val)'), '') call assert_equal('world ', line) ! call popup_move(winid, *{line: 2, col: 2}) redraw let line = join(map(range(1, 6), 'screenstring(1, v:val)'), '') call assert_equal('hello ', line) let line = join(map(range(1, 6), 'screenstring(2, v:val)'), '') call assert_equal('~world', line) ! call popup_move(winid, *{line: 1}) redraw let line = join(map(range(1, 6), 'screenstring(1, v:val)'), '') call assert_equal('hworld', line) *************** *** 828,838 **** endfunc func Test_popup_getpos() ! let winid = popup_create('hello', { ! \ 'line': 2, ! \ 'col': 3, ! \ 'minwidth': 10, ! \ 'minheight': 11, \}) redraw let res = popup_getpos(winid) --- 828,838 ---- endfunc func Test_popup_getpos() ! let winid = popup_create('hello', *{ ! \ line: 2, ! \ col: 3, ! \ minwidth: 10, ! \ minheight: 11, \}) redraw let res = popup_getpos(winid) *************** *** 855,861 **** \ ] for test in tests ! let winid = popup_create(test[0], {'line': 2, 'col': 3}) redraw let position = popup_getpos(winid) call assert_equal(test[1], position.width) --- 855,861 ---- \ ] for test in tests ! let winid = popup_create(test[0], *{line: 2, col: 3}) redraw let position = popup_getpos(winid) call assert_equal(test[1], position.width) *************** *** 871,877 **** \ ] for test in tests let winid = popup_create(test[0], ! \ {'line': 2, 'col': 3, 'maxwidth': 12}) redraw let position = popup_getpos(winid) call assert_equal(test[1], position.width) --- 871,877 ---- \ ] for test in tests let winid = popup_create(test[0], ! \ *{line: 2, col: 3, maxwidth: 12}) redraw let position = popup_getpos(winid) call assert_equal(test[1], position.width) *************** *** 883,898 **** endfunc func Test_popup_getoptions() ! let winid = popup_create('hello', { ! \ 'line': 2, ! \ 'col': 3, ! \ 'minwidth': 10, ! \ 'minheight': 11, ! \ 'maxwidth': 20, ! \ 'maxheight': 21, ! \ 'zindex': 100, ! \ 'time': 5000, ! \ 'fixed': 1 \}) redraw let res = popup_getoptions(winid) --- 883,898 ---- endfunc func Test_popup_getoptions() ! let winid = popup_create('hello', *{ ! \ line: 2, ! \ col: 3, ! \ minwidth: 10, ! \ minheight: 11, ! \ maxwidth: 20, ! \ maxheight: 21, ! \ zindex: 100, ! \ time: 5000, ! \ fixed: 1 \}) redraw let res = popup_getoptions(winid) *************** *** 976,985 **** call cursor(1, 1) redraw ! let winid = popup_create('vim', { ! \ 'line': 'cursor+2', ! \ 'col': 'cursor+1', ! \}) redraw let line = join(map(range(1, 17), 'screenstring(3, v:val)'), '') call assert_equal('xvimxxxxxxxxxxxxx', line) --- 976,985 ---- call cursor(1, 1) redraw ! let winid = popup_create('vim', *{ ! \ line: 'cursor+2', ! \ col: 'cursor+1', ! \}) redraw let line = join(map(range(1, 17), 'screenstring(3, v:val)'), '') call assert_equal('xvimxxxxxxxxxxxxx', line) *************** *** 987,996 **** call cursor(3, 3) redraw ! let winid = popup_create('vim', { ! \ 'line': 'cursor-2', ! \ 'col': 'cursor-1', ! \}) redraw let line = join(map(range(1, 17), 'screenstring(1, v:val)'), '') call assert_equal('xvimxxxxxxxxxxxxx', line) --- 987,996 ---- call cursor(3, 3) redraw ! let winid = popup_create('vim', *{ ! \ line: 'cursor-2', ! \ col: 'cursor-1', ! \}) redraw let line = join(map(range(1, 17), 'screenstring(1, v:val)'), '') call assert_equal('xvimxxxxxxxxxxxxx', line) *************** *** 1056,1062 **** endfunc END call writefile(lines, 'XtestPopupBeval') ! let buf = RunVimInTerminal('-S XtestPopupBeval', {'rows': 10}) call term_wait(buf, 100) call term_sendkeys(buf, 'j') call term_sendkeys(buf, ":call Hover()\") --- 1056,1062 ---- endfunc END call writefile(lines, 'XtestPopupBeval') ! let buf = RunVimInTerminal('-S XtestPopupBeval', *{rows: 10}) call term_wait(buf, 100) call term_sendkeys(buf, 'j') call term_sendkeys(buf, ":call Hover()\") *************** *** 1093,1099 **** return 0 endfunc ! let winid = popup_create('something', {'filter': 'MyPopupFilter'}) redraw " e is consumed by the filter --- 1093,1099 ---- return 0 endfunc ! let winid = popup_create('something', *{filter: 'MyPopupFilter'}) redraw " e is consumed by the filter *************** *** 1118,1126 **** func ShowDialog(key, result) let s:cb_res = 999 ! let winid = popup_dialog('do you want to quit (Yes/no)?', { ! \ 'filter': 'popup_filter_yesno', ! \ 'callback': 'QuitCallback', \ }) redraw call feedkeys(a:key, "xt") --- 1118,1126 ---- func ShowDialog(key, result) let s:cb_res = 999 ! let winid = popup_dialog('do you want to quit (Yes/no)?', *{ ! \ filter: 'popup_filter_yesno', ! \ callback: 'QuitCallback', \ }) redraw call feedkeys(a:key, "xt") *************** *** 1148,1155 **** func ShowMenu(key, result) let s:cb_res = 999 ! let winid = popup_menu(['one', 'two', 'something else'], { ! \ 'callback': 'QuitCallback', \ }) redraw call feedkeys(a:key, "xt") --- 1148,1155 ---- func ShowMenu(key, result) let s:cb_res = 999 ! let winid = popup_menu(['one', 'two', 'something else'], *{ ! \ callback: 'QuitCallback', \ }) redraw call feedkeys(a:key, "xt") *************** *** 1184,1196 **** let lines =<< trim END call setline(1, range(1, 20)) hi PopupSelected ctermbg=lightblue ! call popup_menu(['one', 'two', 'another'], {'callback': 'MenuDone', 'title': ' make a choice from the list '}) func MenuDone(id, res) echomsg "selected " .. a:res endfunc END call writefile(lines, 'XtestPopupMenu') ! let buf = RunVimInTerminal('-S XtestPopupMenu', {'rows': 10}) call VerifyScreenDump(buf, 'Test_popupwin_menu_01', {}) call term_sendkeys(buf, "jj") --- 1184,1196 ---- let lines =<< trim END call setline(1, range(1, 20)) hi PopupSelected ctermbg=lightblue ! call popup_menu(['one', 'two', 'another'], *{callback: 'MenuDone', title: ' make a choice from the list '}) func MenuDone(id, res) echomsg "selected " .. a:res endfunc END call writefile(lines, 'XtestPopupMenu') ! let buf = RunVimInTerminal('-S XtestPopupMenu', *{rows: 10}) call VerifyScreenDump(buf, 'Test_popupwin_menu_01', {}) call term_sendkeys(buf, "jj") *************** *** 1213,1231 **** " put the title on. let lines =<< trim END call setline(1, range(1, 20)) ! call popup_create(['one', 'two', 'another'], {'title': 'Title String'}) END call writefile(lines, 'XtestPopupTitle') ! let buf = RunVimInTerminal('-S XtestPopupTitle', {'rows': 10}) call VerifyScreenDump(buf, 'Test_popupwin_title', {}) " clean up call StopVimInTerminal(buf) call delete('XtestPopupTitle') ! let winid = popup_create('something', {'title': 'Some Title'}) call assert_equal('Some Title', popup_getoptions(winid).title) ! call popup_setoptions(winid, {'title': 'Another Title'}) call assert_equal('Another Title', popup_getoptions(winid).title) call popup_clear() --- 1213,1231 ---- " put the title on. let lines =<< trim END call setline(1, range(1, 20)) ! call popup_create(['one', 'two', 'another'], *{title: 'Title String'}) END call writefile(lines, 'XtestPopupTitle') ! let buf = RunVimInTerminal('-S XtestPopupTitle', *{rows: 10}) call VerifyScreenDump(buf, 'Test_popupwin_title', {}) " clean up call StopVimInTerminal(buf) call delete('XtestPopupTitle') ! let winid = popup_create('something', *{title: 'Some Title'}) call assert_equal('Some Title', popup_getoptions(winid).title) ! call popup_setoptions(winid, *{title: 'Another Title'}) call assert_equal('Another Title', popup_getoptions(winid).title) call popup_clear() *************** *** 1235,1254 **** func PopupDone(id, result) let g:result = a:result endfunc ! let winid = popup_create('something', {'callback': 'PopupDone'}) redraw call popup_close(winid, 'done') call assert_equal('done', g:result) endfunc func Test_popup_empty() ! let winid = popup_create('', {'padding': [2,2,2,2]}) redraw let pos = popup_getpos(winid) call assert_equal(5, pos.width) call assert_equal(5, pos.height) ! let winid = popup_create([], {'border': []}) redraw let pos = popup_getpos(winid) call assert_equal(3, pos.width) --- 1235,1254 ---- func PopupDone(id, result) let g:result = a:result endfunc ! let winid = popup_create('something', *{callback: 'PopupDone'}) redraw call popup_close(winid, 'done') call assert_equal('done', g:result) endfunc func Test_popup_empty() ! let winid = popup_create('', *{padding: [2,2,2,2]}) redraw let pos = popup_getpos(winid) call assert_equal(5, pos.width) call assert_equal(5, pos.height) ! let winid = popup_create([], *{border: []}) redraw let pos = popup_getpos(winid) call assert_equal(3, pos.width) *************** *** 1277,1289 **** let info_window1 = getwininfo()[0] let line = info_window1['height'] let col = info_window1['width'] ! call popup_create(['line1', 'line2', 'line3', 'line4'], { ! \ 'line' : line, ! \ 'col' : col, \ }) END call writefile(lines, 'XtestPopupBehind') ! let buf = RunVimInTerminal('-S XtestPopupBehind', {'rows': 10}) call term_sendkeys(buf, "\w") call VerifyScreenDump(buf, 'Test_popupwin_behind', {}) --- 1277,1289 ---- let info_window1 = getwininfo()[0] let line = info_window1['height'] let col = info_window1['width'] ! call popup_create(['line1', 'line2', 'line3', 'line4'], *{ ! \ line : line, ! \ col : col, \ }) END call writefile(lines, 'XtestPopupBehind') ! let buf = RunVimInTerminal('-S XtestPopupBehind', *{rows: 10}) call term_sendkeys(buf, "\w") call VerifyScreenDump(buf, 'Test_popupwin_behind', {}) *************** *** 1340,1352 **** " - expected width " - expected height let tests = [ ! \ { ! \ 'comment': 'left-aligned with wrapping', ! \ 'options': { ! \ 'wrap': 1, ! \ 'pos': 'botleft', \ }, ! \ 'tests': both_wrap_tests + [ \ [ 'aaaa', 5, &columns, 4, &columns - 2, 3, 2 ], \ [ 'bbbb', 5, &columns + 1, 4, &columns - 2, 3, 2 ], \ [ 'cccc', 5, &columns - 1, 4, &columns - 2, 3, 2 ], --- 1340,1352 ---- " - expected width " - expected height let tests = [ ! \ *{ ! \ comment: 'left-aligned with wrapping', ! \ options: *{ ! \ wrap: 1, ! \ pos: 'botleft', \ }, ! \ tests: both_wrap_tests + [ \ [ 'aaaa', 5, &columns, 4, &columns - 2, 3, 2 ], \ [ 'bbbb', 5, &columns + 1, 4, &columns - 2, 3, 2 ], \ [ 'cccc', 5, &columns - 1, 4, &columns - 2, 3, 2 ], *************** *** 1354,1366 **** \ [ 'eeee', 5, &columns - 3, 5, &columns - 3, 4, 1 ], \ ], \ }, ! \ { ! \ 'comment': 'left aligned without wrapping', ! \ 'options': { ! \ 'wrap': 0, ! \ 'pos': 'botleft', \ }, ! \ 'tests': both_wrap_tests + [ \ [ 'aaaa', 5, &columns, 5, &columns - 3, 4, 1 ], \ [ 'bbbb', 5, &columns + 1, 5, &columns - 3, 4, 1 ], \ [ 'cccc', 5, &columns - 1, 5, &columns - 3, 4, 1 ], --- 1354,1366 ---- \ [ 'eeee', 5, &columns - 3, 5, &columns - 3, 4, 1 ], \ ], \ }, ! \ *{ ! \ comment: 'left aligned without wrapping', ! \ options: *{ ! \ wrap: 0, ! \ pos: 'botleft', \ }, ! \ tests: both_wrap_tests + [ \ [ 'aaaa', 5, &columns, 5, &columns - 3, 4, 1 ], \ [ 'bbbb', 5, &columns + 1, 5, &columns - 3, 4, 1 ], \ [ 'cccc', 5, &columns - 1, 5, &columns - 3, 4, 1 ], *************** *** 1368,1381 **** \ [ 'eeee', 5, &columns - 3, 5, &columns - 3, 4, 1 ], \ ], \ }, ! \ { ! \ 'comment': 'left aligned with fixed position', ! \ 'options': { ! \ 'wrap': 0, ! \ 'fixed': 1, ! \ 'pos': 'botleft', \ }, ! \ 'tests': both_wrap_tests + [ \ [ 'aaaa', 5, &columns, 5, &columns - 2, 3, 1 ], \ [ 'bbbb', 5, &columns + 1, 5, &columns - 2, 3, 1 ], \ [ 'cccc', 5, &columns - 1, 5, &columns - 2, 3, 1 ], --- 1368,1381 ---- \ [ 'eeee', 5, &columns - 3, 5, &columns - 3, 4, 1 ], \ ], \ }, ! \ *{ ! \ comment: 'left aligned with fixed position', ! \ options: *{ ! \ wrap: 0, ! \ fixed: 1, ! \ pos: 'botleft', \ }, ! \ tests: both_wrap_tests + [ \ [ 'aaaa', 5, &columns, 5, &columns - 2, 3, 1 ], \ [ 'bbbb', 5, &columns + 1, 5, &columns - 2, 3, 1 ], \ [ 'cccc', 5, &columns - 1, 5, &columns - 2, 3, 1 ], *************** *** 1388,1404 **** for test_group in tests for test in test_group.tests let [ text, line, col, e_line, e_col, e_width, e_height ] = test ! let options = { ! \ 'line': line, ! \ 'col': col, \ } call extend( options, test_group.options ) let p = popup_create( text, options ) ! let msg = string( extend( options, { 'text': text } ) ) ! call s:VerifyPosition( p, msg, e_line, e_col, e_width, e_height ) ! call popup_close( p ) endfor endfor --- 1388,1404 ---- for test_group in tests for test in test_group.tests let [ text, line, col, e_line, e_col, e_width, e_height ] = test ! let options = *{ ! \ line: line, ! \ col: col, \ } call extend( options, test_group.options ) let p = popup_create( text, options ) ! let msg = string(extend(options, *{text: text})) ! call s:VerifyPosition(p, msg, e_line, e_col, e_width, e_height) ! call popup_close(p) endfor endfor *************** *** 1410,1416 **** " width of screen let X = join(map(range(&columns), {->'X'}), '') ! let p = popup_create( X, { 'line': 1, 'col': 1, 'wrap': 0 } ) call s:VerifyPosition( p, 'full width topleft', 1, 1, &columns, 1 ) redraw --- 1410,1416 ---- " width of screen let X = join(map(range(&columns), {->'X'}), '') ! let p = popup_create( X, *{line: 1, col: 1, wrap: 0}) call s:VerifyPosition( p, 'full width topleft', 1, 1, &columns, 1 ) redraw *************** *** 1421,1427 **** redraw " Same if placed on the right hand side ! let p = popup_create( X, { 'line': 1, 'col': &columns, 'wrap': 0 } ) call s:VerifyPosition( p, 'full width topright', 1, 1, &columns, 1 ) redraw --- 1421,1427 ---- redraw " Same if placed on the right hand side ! let p = popup_create( X, *{line: 1, col: &columns, wrap: 0}) call s:VerifyPosition( p, 'full width topright', 1, 1, &columns, 1 ) redraw *************** *** 1434,1440 **** " Extend so > window width let X .= 'x' ! let p = popup_create( X, { 'line': 1, 'col': 1, 'wrap': 0 } ) call s:VerifyPosition( p, 'full width + 1 topleft', 1, 1, &columns, 1 ) redraw --- 1434,1440 ---- " Extend so > window width let X .= 'x' ! let p = popup_create( X, *{line: 1, col: 1, wrap: 0}) call s:VerifyPosition( p, 'full width + 1 topleft', 1, 1, &columns, 1 ) redraw *************** *** 1445,1451 **** redraw " Shifted then truncated (the x is not visible) ! let p = popup_create( X, { 'line': 1, 'col': &columns - 3, 'wrap': 0 } ) call s:VerifyPosition( p, 'full width + 1 topright', 1, 1, &columns, 1 ) redraw --- 1445,1451 ---- redraw " Shifted then truncated (the x is not visible) ! let p = popup_create( X, *{line: 1, col: &columns - 3, wrap: 0}) call s:VerifyPosition( p, 'full width + 1 topright', 1, 1, &columns, 1 ) redraw *************** *** 1457,1463 **** " Not shifted, just truncated let p = popup_create( X, ! \ { 'line': 1, 'col': 2, 'wrap': 0, 'fixed': 1 } ) call s:VerifyPosition( p, 'full width + 1 fixed', 1, 2, &columns - 1, 1) redraw --- 1457,1463 ---- " Not shifted, just truncated let p = popup_create( X, ! \ *{line: 1, col: 2, wrap: 0, fixed: 1}) call s:VerifyPosition( p, 'full width + 1 fixed', 1, 2, &columns - 1, 1) redraw *************** *** 1478,1484 **** call setline(1, ['one word to move around', 'a WORD.and->some thing']) exe "normal gg0/word\" ! let winid = popup_atcursor('text', {'moved': 'any'}) redraw call assert_equal(1, popup_getpos(winid).visible) call assert_equal([1, 4, 4], popup_getoptions(winid).moved) --- 1478,1484 ---- call setline(1, ['one word to move around', 'a WORD.and->some thing']) exe "normal gg0/word\" ! let winid = popup_atcursor('text', *{moved: 'any'}) redraw call assert_equal(1, popup_getpos(winid).visible) call assert_equal([1, 4, 4], popup_getoptions(winid).moved) *************** *** 1488,1494 **** call popup_clear() exe "normal gg0/word\" ! let winid = popup_atcursor('text', {'moved': 'word'}) redraw call assert_equal(1, popup_getpos(winid).visible) call assert_equal([1, 4, 7], popup_getoptions(winid).moved) --- 1488,1494 ---- call popup_clear() exe "normal gg0/word\" ! let winid = popup_atcursor('text', *{moved: 'word'}) redraw call assert_equal(1, popup_getpos(winid).visible) call assert_equal([1, 4, 7], popup_getoptions(winid).moved) *************** *** 1497,1503 **** call popup_clear() exe "normal gg0/word\" ! let winid = popup_atcursor('text', {'moved': 'word'}) redraw call assert_equal(1, popup_getpos(winid).visible) call assert_equal([1, 4, 7], popup_getoptions(winid).moved) --- 1497,1503 ---- call popup_clear() exe "normal gg0/word\" ! let winid = popup_atcursor('text', *{moved: 'word'}) redraw call assert_equal(1, popup_getpos(winid).visible) call assert_equal([1, 4, 7], popup_getoptions(winid).moved) *************** *** 1524,1530 **** call popup_clear() exe "normal gg0/word\" ! let winid = popup_atcursor('text', {'moved': [5, 10]}) redraw call assert_equal(1, popup_getpos(winid).visible) call feedkeys("eli\", 'xt') --- 1524,1530 ---- call popup_clear() exe "normal gg0/word\" ! let winid = popup_atcursor('text', *{moved: [5, 10]}) redraw call assert_equal(1, popup_getpos(winid).visible) call feedkeys("eli\", 'xt') *************** *** 1551,1557 **** \ "hi Notification ctermbg=lightblue", \ "call popup_notification('first notification', {})", \], 'XtestNotifications') ! let buf = RunVimInTerminal('-S XtestNotifications', {'rows': 10}) call VerifyScreenDump(buf, 'Test_popupwin_notify_01', {}) " second one goes below the first one --- 1551,1557 ---- \ "hi Notification ctermbg=lightblue", \ "call popup_notification('first notification', {})", \], 'XtestNotifications') ! let buf = RunVimInTerminal('-S XtestNotifications', *{rows: 10}) call VerifyScreenDump(buf, 'Test_popupwin_notify_01', {}) " second one goes below the first one *************** *** 1574,1582 **** hi ScrollThumb ctermbg=blue hi ScrollBar ctermbg=red let winid = popup_create(['one', 'two', 'three', 'four', 'five', ! \ 'six', 'seven', 'eight', 'nine'], { ! \ 'minwidth': 8, ! \ 'maxheight': 4, \ }) func ScrollUp() call feedkeys("\\", "xt") --- 1574,1582 ---- hi ScrollThumb ctermbg=blue hi ScrollBar ctermbg=red let winid = popup_create(['one', 'two', 'three', 'four', 'five', ! \ 'six', 'seven', 'eight', 'nine'], *{ ! \ minwidth: 8, ! \ maxheight: 4, \ }) func ScrollUp() call feedkeys("\\", "xt") *************** *** 1588,1594 **** call feedkeys("\\", "xt") endfunc func ClickBot() ! call popup_setoptions(g:winid, {'border': [], 'close': 'button'}) call feedkeys("\\", "xt") endfunc map :call test_setmouse(5, 36) --- 1588,1594 ---- call feedkeys("\\", "xt") endfunc func ClickBot() ! call popup_setoptions(g:winid, *{border: [], close: 'button'}) call feedkeys("\\", "xt") endfunc map :call test_setmouse(5, 36) *************** *** 1596,1614 **** map :call test_setmouse(7, 42) END call writefile(lines, 'XtestPopupScroll') ! let buf = RunVimInTerminal('-S XtestPopupScroll', {'rows': 10}) call VerifyScreenDump(buf, 'Test_popupwin_scroll_1', {}) ! call term_sendkeys(buf, ":call popup_setoptions(winid, {'firstline': 2})\") call VerifyScreenDump(buf, 'Test_popupwin_scroll_2', {}) ! call term_sendkeys(buf, ":call popup_setoptions(winid, {'firstline': 6})\") call VerifyScreenDump(buf, 'Test_popupwin_scroll_3', {}) ! call term_sendkeys(buf, ":call popup_setoptions(winid, {'firstline': 9})\") call VerifyScreenDump(buf, 'Test_popupwin_scroll_4', {}) ! call term_sendkeys(buf, ":call popup_setoptions(winid, {'scrollbarhighlight': 'ScrollBar', 'thumbhighlight': 'ScrollThumb'})\") call term_sendkeys(buf, ":call ScrollUp()\") call VerifyScreenDump(buf, 'Test_popupwin_scroll_5', {}) --- 1596,1614 ---- map :call test_setmouse(7, 42) END call writefile(lines, 'XtestPopupScroll') ! let buf = RunVimInTerminal('-S XtestPopupScroll', *{rows: 10}) call VerifyScreenDump(buf, 'Test_popupwin_scroll_1', {}) ! call term_sendkeys(buf, ":call popup_setoptions(winid, *{firstline: 2})\") call VerifyScreenDump(buf, 'Test_popupwin_scroll_2', {}) ! call term_sendkeys(buf, ":call popup_setoptions(winid, *{firstline: 6})\") call VerifyScreenDump(buf, 'Test_popupwin_scroll_3', {}) ! call term_sendkeys(buf, ":call popup_setoptions(winid, *{firstline: 9})\") call VerifyScreenDump(buf, 'Test_popupwin_scroll_4', {}) ! call term_sendkeys(buf, ":call popup_setoptions(winid, *{scrollbarhighlight: 'ScrollBar', thumbhighlight: 'ScrollThumb'})\") call term_sendkeys(buf, ":call ScrollUp()\") call VerifyScreenDump(buf, 'Test_popupwin_scroll_5', {}) *************** *** 1637,1647 **** func Test_popup_fitting_scrollbar() " this was causing a crash, divide by zero let winid = popup_create([ ! \ 'one', 'two', 'longer line that wraps', 'four', 'five'], { ! \ 'scrollbar': 1, ! \ 'maxwidth': 10, ! \ 'maxheight': 5, ! \ 'firstline': 2}) redraw call popup_clear() endfunc --- 1637,1647 ---- func Test_popup_fitting_scrollbar() " this was causing a crash, divide by zero let winid = popup_create([ ! \ 'one', 'two', 'longer line that wraps', 'four', 'five'], *{ ! \ scrollbar: 1, ! \ maxwidth: 10, ! \ maxheight: 5, ! \ firstline: 2}) redraw call popup_clear() endfunc *************** *** 1652,1664 **** endif let lines =<< trim END ! let opts = {'wrap': 0} let p = popup_create('test', opts) call popup_settext(p, 'this is a text') END call writefile( lines, 'XtestPopupSetText' ) ! let buf = RunVimInTerminal('-S XtestPopupSetText', {'rows': 10}) call VerifyScreenDump(buf, 'Test_popup_settext_01', {}) " Setting to empty string clears it --- 1652,1664 ---- endif let lines =<< trim END ! let opts = *{wrap: 0} let p = popup_create('test', opts) call popup_settext(p, 'this is a text') END call writefile( lines, 'XtestPopupSetText' ) ! let buf = RunVimInTerminal('-S XtestPopupSetText', *{rows: 10}) call VerifyScreenDump(buf, 'Test_popup_settext_01', {}) " Setting to empty string clears it *************** *** 1682,1688 **** call VerifyScreenDump(buf, 'Test_popup_settext_05', {}) " Dicts ! call term_sendkeys(buf, ":call popup_settext(p, [{'text': 'aaaa'}, {'text': 'bbbb'}, {'text': 'cccc'}])\") call VerifyScreenDump(buf, 'Test_popup_settext_06', {}) " clean up --- 1682,1688 ---- call VerifyScreenDump(buf, 'Test_popup_settext_05', {}) " Dicts ! call term_sendkeys(buf, ":call popup_settext(p, [*{text: 'aaaa'}, *{text: 'bbbb'}, *{text: 'cccc'}])\") call VerifyScreenDump(buf, 'Test_popup_settext_06', {}) " clean up *************** *** 1693,1704 **** func Test_popup_hidden() new ! let winid = popup_atcursor('text', {'hidden': 1}) redraw call assert_equal(0, popup_getpos(winid).visible) call popup_close(winid) ! let winid = popup_create('text', {'hidden': 1}) redraw call assert_equal(0, popup_getpos(winid).visible) call popup_close(winid) --- 1693,1704 ---- func Test_popup_hidden() new ! let winid = popup_atcursor('text', *{hidden: 1}) redraw call assert_equal(0, popup_getpos(winid).visible) call popup_close(winid) ! let winid = popup_create('text', *{hidden: 1}) redraw call assert_equal(0, popup_getpos(winid).visible) call popup_close(winid) *************** *** 1707,1715 **** let s:cb_winid = a:id let s:cb_res = a:res endfunc ! let winid = popup_dialog('make a choice', {'hidden': 1, ! \ 'filter': 'popup_filter_yesno', ! \ 'callback': 'QuitCallback', \ }) redraw call assert_equal(0, popup_getpos(winid).visible) --- 1707,1715 ---- let s:cb_winid = a:id let s:cb_res = a:res endfunc ! let winid = popup_dialog('make a choice', *{hidden: 1, ! \ filter: 'popup_filter_yesno', ! \ callback: 'QuitCallback', \ }) redraw call assert_equal(0, popup_getpos(winid).visible) *************** *** 1728,1740 **** " Test options not checked elsewhere func Test_set_get_options() ! let winid = popup_create('some text', {'highlight': 'Beautiful'}) let options = popup_getoptions(winid) call assert_equal(1, options.wrap) call assert_equal(0, options.drag) call assert_equal('Beautiful', options.highlight) ! call popup_setoptions(winid, {'wrap': 0, 'drag': 1, 'highlight': 'Another'}) let options = popup_getoptions(winid) call assert_equal(0, options.wrap) call assert_equal(1, options.drag) --- 1728,1740 ---- " Test options not checked elsewhere func Test_set_get_options() ! let winid = popup_create('some text', *{highlight: 'Beautiful'}) let options = popup_getoptions(winid) call assert_equal(1, options.wrap) call assert_equal(0, options.drag) call assert_equal('Beautiful', options.highlight) ! call popup_setoptions(winid, *{wrap: 0, drag: 1, highlight: 'Another'}) let options = popup_getoptions(winid) call assert_equal(0, options.wrap) call assert_equal(1, options.drag) *************** *** 1748,1754 **** " NOP endfunc ! let winid = popup_create('something', {'filter': function('MyPopupFilter', [{}])}) call test_garbagecollect_now() redraw " Must not crach caused by invalid memory access --- 1748,1754 ---- " NOP endfunc ! let winid = popup_create('something', *{filter: function('MyPopupFilter', [{}])}) call test_garbagecollect_now() redraw " Must not crach caused by invalid memory access *************** *** 1781,1792 **** endfunc func Test_popupwin_width() ! let winid = popup_create(repeat(['short', 'long long long line', 'medium width'], 50), { ! \ 'maxwidth': 40, ! \ 'maxheight': 10, \ }) for top in range(1, 20) ! call popup_setoptions(winid, {'firstline': top}) redraw call assert_equal(19, popup_getpos(winid).width) endfor --- 1781,1792 ---- endfunc func Test_popupwin_width() ! let winid = popup_create(repeat(['short', 'long long long line', 'medium width'], 50), *{ ! \ maxwidth: 40, ! \ maxheight: 10, \ }) for top in range(1, 20) ! call popup_setoptions(winid, *{firstline: top}) redraw call assert_equal(19, popup_getpos(winid).width) endfor *************** *** 1830,1842 **** hi ScrollThumb ctermbg=blue hi ScrollBar ctermbg=red func PopupMenu(lines, line, col, scrollbar = 0) ! return popup_menu(a:lines, { ! \ 'maxwidth': 10, ! \ 'maxheight': 3, ! \ 'pos' : 'topleft', ! \ 'col' : a:col, ! \ 'line' : a:line, ! \ 'scrollbar' : a:scrollbar, \ }) endfunc call PopupMenu(['x'], 1, 1) --- 1830,1842 ---- hi ScrollThumb ctermbg=blue hi ScrollBar ctermbg=red func PopupMenu(lines, line, col, scrollbar = 0) ! return popup_menu(a:lines, *{ ! \ maxwidth: 10, ! \ maxheight: 3, ! \ pos : 'topleft', ! \ col : a:col, ! \ line : a:line, ! \ scrollbar : a:scrollbar, \ }) endfunc call PopupMenu(['x'], 1, 1) *************** *** 1846,1852 **** call PopupMenu(repeat(['123456789|' .. ' '], 5), 1, 33, 1) END call writefile(lines, 'XtestPopupMenuMaxWidth') ! let buf = RunVimInTerminal('-S XtestPopupMenuMaxWidth', {'rows': 13}) call VerifyScreenDump(buf, 'Test_popupwin_menu_maxwidth_1', {}) " close the menu popupwin. --- 1846,1852 ---- call PopupMenu(repeat(['123456789|' .. ' '], 5), 1, 33, 1) END call writefile(lines, 'XtestPopupMenuMaxWidth') ! let buf = RunVimInTerminal('-S XtestPopupMenuMaxWidth', *{rows: 13}) call VerifyScreenDump(buf, 'Test_popupwin_menu_maxwidth_1', {}) " close the menu popupwin. *************** *** 1871,1883 **** hi ScrollThumb ctermbg=blue hi ScrollBar ctermbg=red call popup_menu(['one', 'two', 'three', 'four', 'five', ! \ 'six', 'seven', 'eight', 'nine'], { ! \ 'minwidth': 8, ! \ 'maxheight': 3, \ }) END call writefile(lines, 'XtestPopupMenuScroll') ! let buf = RunVimInTerminal('-S XtestPopupMenuScroll', {'rows': 10}) call term_sendkeys(buf, "j") call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_1', {}) --- 1871,1883 ---- hi ScrollThumb ctermbg=blue hi ScrollBar ctermbg=red call popup_menu(['one', 'two', 'three', 'four', 'five', ! \ 'six', 'seven', 'eight', 'nine'], *{ ! \ minwidth: 8, ! \ maxheight: 3, \ }) END call writefile(lines, 'XtestPopupMenuScroll') ! let buf = RunVimInTerminal('-S XtestPopupMenuScroll', *{rows: 10}) call term_sendkeys(buf, "j") call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_1', {}) *** ../vim-8.1.1682/src/testdir/dumps/Test_popupwin_07.dump 2019-06-08 19:00:58.069909734 +0200 --- src/testdir/dumps/Test_popupwin_07.dump 2019-07-13 21:48:09.005186889 +0200 *************** *** 6,10 **** |~| @73 |~| @52|o+0#0000001#ffd7ff255|t|h|e|r| |t|a|b| @11 |~+0#4040ff13#ffffff0| @52|a+0#0000001#ffd7ff255| |c+0#ff404010&|o|m@1|e|n|t| +0#0000001&|l|i|n|e| @6 ! |:+0#0000000#ffffff0|c|a|l@1| |p|o|p|u|p|_|m|o|v|e|(|p|o|p|u|p|w|i|n|,| |{|'|l|i|n|e|'|:| |7|,| |'|c|o|l|'|:| |5@1|}|)| @3|t+0#0000001#ffd7ff255|h|i|s| |l|i|n|e| |w|i|l@1| |n|o|t| |f|i | +0#0000000#ffffff0@53|t+0#0000001#ffd7ff255| |h|e|r|e| @14 --- 6,10 ---- |~| @73 |~| @52|o+0#0000001#ffd7ff255|t|h|e|r| |t|a|b| @11 |~+0#4040ff13#ffffff0| @52|a+0#0000001#ffd7ff255| |c+0#ff404010&|o|m@1|e|n|t| +0#0000001&|l|i|n|e| @6 ! |:+0#0000000#ffffff0|c|a|l@1| |p|o|p|u|p|_|m|o|v|e|(|p|o|p|u|p|w|i|n|,| |*|{|l|i|n|e|:| |7|,| |c|o|l|:| |5@1|}|)| @6|t+0#0000001#ffd7ff255|h|i|s| |l|i|n|e| |w|i|l@1| |n|o|t| |f|i | +0#0000000#ffffff0@53|t+0#0000001#ffd7ff255| |h|e|r|e| @14 *** ../vim-8.1.1682/src/testdir/dumps/Test_popupwin_mask_2.dump 2019-07-03 22:50:37.204501383 +0200 --- src/testdir/dumps/Test_popupwin_mask_2.dump 2019-07-13 22:20:30.956870965 +0200 *************** *** 10,13 **** |1|2|3|4|5|6|7|8|9|1|0|║+0#0000001#ffd7ff255| @10|1+0#0000000#ffffff0|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 |1|2|3|4|5|6|7|8|9|1|0|╚+0#0000001#ffd7ff255|═|1+0#0000000#ffffff0|2|1|═+0#0000001#ffd7ff255@4|1+0#0000000#ffffff0|6|1|7|═+0#0000001#ffd7ff255@1|╝|9+0#0000000#ffffff0|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 |1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 ! |:|c|a|l@1| |p|o|p|u|p|_|m|o|v|e|(|w|i|n|i|d|b|,| |{|'|c|o|l|'|:| |1|2|}|)| @19|1|,|1| @10|T|o|p| --- 10,13 ---- |1|2|3|4|5|6|7|8|9|1|0|║+0#0000001#ffd7ff255| @10|1+0#0000000#ffffff0|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 |1|2|3|4|5|6|7|8|9|1|0|╚+0#0000001#ffd7ff255|═|1+0#0000000#ffffff0|2|1|═+0#0000001#ffd7ff255@4|1+0#0000000#ffffff0|6|1|7|═+0#0000001#ffd7ff255@1|╝|9+0#0000000#ffffff0|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 |1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 ! |:|c|a|l@1| |p|o|p|u|p|_|m|o|v|e|(|w|i|n|i|d|b|,| |*|{|c|o|l|:| |1|2|}|)| @20|1|,|1| @10|T|o|p| *** ../vim-8.1.1682/src/testdir/dumps/Test_popupwin_mask_3.dump 2019-07-03 22:50:37.204501383 +0200 --- src/testdir/dumps/Test_popupwin_mask_3.dump 2019-07-13 22:21:31.424607743 +0200 *************** *** 10,13 **** |1+0#0000000#ffffff0|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|║+0#0000001#ffd7ff255| @10|2+0#0000000#ffffff0 |1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|╚+0#0000001#ffd7ff255|═|7+0#0000000#ffffff0|3|8|═+0#0000001#ffd7ff255@4|1+0#0000000#ffffff0|4|2 |1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 ! |:|c|a|l@1| |p|o|p|u|p|_|m|o|v|e|(|w|i|n|i|d|b|,| |{|'|c|o|l|'|:| |6|3|}|)| @19|1|,|1| @10|T|o|p| --- 10,13 ---- |1+0#0000000#ffffff0|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|║+0#0000001#ffd7ff255| @10|2+0#0000000#ffffff0 |1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|╚+0#0000001#ffd7ff255|═|7+0#0000000#ffffff0|3|8|═+0#0000001#ffd7ff255@4|1+0#0000000#ffffff0|4|2 |1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 ! |:|c|a|l@1| |p|o|p|u|p|_|m|o|v|e|(|w|i|n|i|d|b|,| |*|{|c|o|l|:| |6|3|}|)| @20|1|,|1| @10|T|o|p| *** ../vim-8.1.1682/src/testdir/dumps/Test_popupwin_mask_4.dump 2019-07-03 22:50:37.204501383 +0200 --- src/testdir/dumps/Test_popupwin_mask_4.dump 2019-07-13 22:21:32.488603110 +0200 *************** *** 10,13 **** | +0#0000001#ffd7ff255@6|8+0#0000000#ffffff0|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 |═+0#0000001#ffd7ff255@4|6+0#0000000#ffffff0|7|8|9|═+0#0000001#ffd7ff255@1|╝|1+0#0000000#ffffff0@1|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 |1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 ! |:|c|a|l@1| |p|o|p|u|p|_|m|o|v|e|(|w|i|n|i|d|b|,| |{|'|p|o|s|'|:| |'|t|o|p|r|i|g|h|t|'|,| |'|c|o|l|'|:| |1|2|}|)| |1|,|1| @10|T|o|p| --- 10,13 ---- | +0#0000001#ffd7ff255@6|8+0#0000000#ffffff0|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 |═+0#0000001#ffd7ff255@4|6+0#0000000#ffffff0|7|8|9|═+0#0000001#ffd7ff255@1|╝|1+0#0000000#ffffff0@1|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 |1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 ! |:|c|a|l@1| |p|o|p|u|p|_|m|o|v|e|(|w|i|n|i|d|b|,| |*|{|p|o|s|:| |'|t|o|p|r|i|g|h|t|'|,| |c|o|l|:| |1|2|}|)| @3|1|,|1| @10|T|o|p| *** ../vim-8.1.1682/src/testdir/dumps/Test_popupwin_mask_5.dump 2019-07-12 16:05:19.822602216 +0200 --- src/testdir/dumps/Test_popupwin_mask_5.dump 2019-07-13 22:22:33.936335512 +0200 *************** *** 10,13 **** |1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 | +0&#e0e0e08@11|1+0&#ffffff0@1|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|═+0#0000001#ffd7ff255@13|X|4+0#0000000#ffffff0|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 |o+0&#e0e0e08|m|e| |5+0&#ffffff0|6|7|t+0&#e0e0e08| @3|1+0&#ffffff0@1|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|║+0#0000001#ffd7ff255| @4|2+0#0000000#ffffff0|9|3| +0#0000001#ffd7ff255@6|║|4+0#0000000#ffffff0|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 ! |:|c|t+0&#e0e0e08|h|l+0&#ffffff0| |p|l+0&#e0e0e08|i|n|e| |m+0&#ffffff0|o|v|e|(|w|i|n|i|d|b|,| |{|'|p|o|s|'|:| |'|t|o|p|l|e|f|t|║+0#0000001#ffd7ff255| |j|u|s|t|l+0#0000000#ffffff0|'|:|e+0#0000001#ffd7ff255| |l|i|n|e| |║|,+0#0000000#ffffff0|1| @10|T|o|p| --- 10,13 ---- |1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 | +0&#e0e0e08@11|1+0&#ffffff0@1|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|═+0#0000001#ffd7ff255@13|X|4+0#0000000#ffffff0|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 |o+0&#e0e0e08|m|e| |5+0&#ffffff0|6|7|t+0&#e0e0e08| @3|1+0&#ffffff0@1|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|║+0#0000001#ffd7ff255| @4|2+0#0000000#ffffff0|9|3| +0#0000001#ffd7ff255@6|║|4+0#0000000#ffffff0|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2 ! |:|c|t+0&#e0e0e08|h|l+0&#ffffff0| |p|l+0&#e0e0e08|i|n|e| |m+0&#ffffff0|o|v|e|(|w|i|n|i|d|b|,| |*|{|p|o|s|:| |'|t|o|p|l|e|f|t|'|║+0#0000001#ffd7ff255| |j|u|s|t| +0#0000000#ffffff0|4|2|e+0#0000001#ffd7ff255| |l|i|n|e| |║|,+0#0000000#ffffff0|1| @10|T|o|p| *** ../vim-8.1.1682/src/testdir/dumps/Test_popupwin_scroll_2.dump 2019-06-26 03:39:59.897650758 +0200 --- src/testdir/dumps/Test_popupwin_scroll_2.dump 2019-07-13 22:32:37.241474878 +0200 *************** *** 7,10 **** |7| @31|f+0#0000001#ffd7ff255|i|v|e| @3| +0#0000000#a8a8a8255| +0&#ffffff0@32 |8| @73 |9| @73 ! |:|c|a|l@1| |p|o|p|u|p|_|s|e|t|o|p|t|i|o|n|s|(|w|i|n|i|d|,| |{|'|f|i|r|s|t|l|i|n|e|'|:| |2|}|)| @9|1|,|1| @10|T|o|p| --- 7,10 ---- |7| @31|f+0#0000001#ffd7ff255|i|v|e| @3| +0#0000000#a8a8a8255| +0&#ffffff0@32 |8| @73 |9| @73 ! |:|c|a|l@1| |p|o|p|u|p|_|s|e|t|o|p|t|i|o|n|s|(|w|i|n|i|d|,| |*|{|f|i|r|s|t|l|i|n|e|:| |2|}|)| @10|1|,|1| @10|T|o|p| *** ../vim-8.1.1682/src/testdir/dumps/Test_popupwin_scroll_3.dump 2019-06-26 03:39:59.897650758 +0200 --- src/testdir/dumps/Test_popupwin_scroll_3.dump 2019-07-13 22:32:38.293469587 +0200 *************** *** 7,10 **** |7| @31|n+0#0000001#ffd7ff255|i|n|e| @3| +0#0000000#0000001| +0&#ffffff0@32 |8| @73 |9| @73 ! |:|c|a|l@1| |p|o|p|u|p|_|s|e|t|o|p|t|i|o|n|s|(|w|i|n|i|d|,| |{|'|f|i|r|s|t|l|i|n|e|'|:| |6|}|)| @9|1|,|1| @10|T|o|p| --- 7,10 ---- |7| @31|n+0#0000001#ffd7ff255|i|n|e| @3| +0#0000000#0000001| +0&#ffffff0@32 |8| @73 |9| @73 ! |:|c|a|l@1| |p|o|p|u|p|_|s|e|t|o|p|t|i|o|n|s|(|w|i|n|i|d|,| |*|{|f|i|r|s|t|l|i|n|e|:| |6|}|)| @10|1|,|1| @10|T|o|p| *** ../vim-8.1.1682/src/testdir/dumps/Test_popupwin_scroll_4.dump 2019-06-25 05:15:15.188891898 +0200 --- src/testdir/dumps/Test_popupwin_scroll_4.dump 2019-07-13 22:32:39.349464275 +0200 *************** *** 7,10 **** |7| @73 |8| @73 |9| @73 ! |:|c|a|l@1| |p|o|p|u|p|_|s|e|t|o|p|t|i|o|n|s|(|w|i|n|i|d|,| |{|'|f|i|r|s|t|l|i|n|e|'|:| |9|}|)| @9|1|,|1| @10|T|o|p| --- 7,10 ---- |7| @73 |8| @73 |9| @73 ! |:|c|a|l@1| |p|o|p|u|p|_|s|e|t|o|p|t|i|o|n|s|(|w|i|n|i|d|,| |*|{|f|i|r|s|t|l|i|n|e|:| |9|}|)| @10|1|,|1| @10|T|o|p| *** ../vim-8.1.1682/src/version.c 2019-07-13 21:18:51.468469559 +0200 --- src/version.c 2019-07-13 22:43:10.610435309 +0200 *************** *** 779,780 **** --- 779,782 ---- { /* Add new patch number below this line */ + /**/ + 1683, /**/ -- The war between Emacs and Vi is over. Vi has won with 3 to 1. http://m.linuxjournal.com/files/linuxjournal.com/linuxjournal/articles/030/3044/3044s1.html /// 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 ///