summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-09-27 21:16:45 +0200
committerBram Moolenaar <Bram@vim.org>2020-09-27 21:16:45 +0200
commit6c542f77eba73a95447f285149b3fcb011aa9675 (patch)
tree2d03d266a3f1781855fca8bddd7bd5838f3ee039
parentd0e1b7103c14eb0d175c6b245b4b6ed93a204da9 (diff)
downloadvim-git-6c542f77eba73a95447f285149b3fcb011aa9675.tar.gz
patch 8.2.1763: Vim9: cannot use "true" for popup window scrollbar optionv8.2.1763
Problem: Vim9: cannot use "true" for popup window scrollbar option. Solution: use dict_get_bool(). (closes #7029)
-rw-r--r--src/popupwin.c6
-rw-r--r--src/testdir/test_popupwin.vim28
-rw-r--r--src/version.c2
3 files changed, 21 insertions, 15 deletions
diff --git a/src/popupwin.c b/src/popupwin.c
index cdd7677e7..05db1af63 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -665,9 +665,9 @@ apply_general_options(win_T *wp, dict_T *dict)
wp->w_firstline = -1;
}
- di = dict_find(dict, (char_u *)"scrollbar", -1);
- if (di != NULL)
- wp->w_want_scrollbar = dict_get_number(dict, (char_u *)"scrollbar");
+ nr = dict_get_bool(dict, (char_u *)"scrollbar", -1);
+ if (nr != -1)
+ wp->w_want_scrollbar = nr;
str = dict_get_string(dict, (char_u *)"title", FALSE);
if (str != NULL)
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 65a6805e2..fdd9ac45e 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -2168,6 +2168,21 @@ func Test_popup_scrollbar()
endif
endfunc
+ def CreatePopup(text: list<string>)
+ popup_create(text, #{
+ \ minwidth: 30,
+ \ maxwidth: 30,
+ \ minheight: 4,
+ \ maxheight: 4,
+ \ firstline: 1,
+ \ lastline: 4,
+ \ wrap: true,
+ \ scrollbar: true,
+ \ mapping: false,
+ \ filter: Popup_filter,
+ \ })
+ enddef
+
func PopupScroll()
call popup_clear()
let text =<< trim END
@@ -2179,18 +2194,7 @@ func Test_popup_scrollbar()
long line long line long line long line long line long line
long line long line long line long line long line long line
END
- call popup_create(text, #{
- \ minwidth: 30,
- \ maxwidth: 30,
- \ minheight: 4,
- \ maxheight: 4,
- \ firstline: 1,
- \ lastline: 4,
- \ wrap: v:true,
- \ scrollbar: v:true,
- \ mapping: v:false,
- \ filter: funcref('Popup_filter')
- \ })
+ call CreatePopup(text)
endfunc
map <silent> <F3> :call test_setmouse(5, 36)<CR>
map <silent> <F4> :call test_setmouse(4, 42)<CR>
diff --git a/src/version.c b/src/version.c
index d6006185c..60ab7d1d6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1763,
+/**/
1762,
/**/
1761,