diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-06-16 20:39:13 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-06-16 20:39:13 +0200 |
commit | 6313c4f41d0e1d91b4217557685c014ea919915f (patch) | |
tree | 57db3a37970820cd76dce1362047e6bbf0f26428 | |
parent | eb2310d47d83764a61d63cd5c2788870d7f6eddf (diff) |
patch 8.1.1560: popup window hidden option not implemented yetv8.1.1560
Problem: Popup window hidden option not implemented yet.
Solution: Implement the hidden option.
-rw-r--r-- | src/popupwin.c | 7 | ||||
-rw-r--r-- | src/testdir/test_popupwin.vim | 38 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 45 insertions, 2 deletions
diff --git a/src/popupwin.c b/src/popupwin.c index 3603a1c717..c042fe82d8 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -428,6 +428,13 @@ apply_options(win_T *wp, buf_T *buf UNUSED, dict_T *dict) semsg(_(e_invarg2), tv_get_string(&di->di_tv)); } + nr = dict_get_number(dict, (char_u *)"hidden"); + if (nr > 0) + { + wp->w_popup_flags |= POPF_HIDDEN; + --wp->w_buffer->b_nwindows; + } + popup_mask_refresh = TRUE; } diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index 3f5c9d1691..749660805c 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -1310,7 +1310,7 @@ func Test_notifications() call delete('XtestNotifications') endfunc -function Test_popup_settext() +func Test_popup_settext() if !CanRunVimInTerminal() throw 'Skipped: cannot make screendumps' endif @@ -1352,4 +1352,38 @@ function Test_popup_settext() " clean up call StopVimInTerminal(buf) call delete('XtestPopupSetText') -endfunction +endfunc + +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) + + func QuitCallback(id, res) + 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) + exe "normal anot used by filter\<Esc>" + call assert_equal('not used by filter', getline(1)) + + call popup_show(winid) + call feedkeys('y', "xt") + call assert_equal(1, s:cb_res) + + bwipe! + delfunc QuitCallback +endfunc diff --git a/src/version.c b/src/version.c index ad09b56ef0..ea203f6913 100644 --- a/src/version.c +++ b/src/version.c @@ -778,6 +778,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1560, +/**/ 1559, /**/ 1558, |