0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.1763: Vim9: cannot use "true" for popup window scrollbar option

Problem:    Vim9: cannot use "true" for popup window scrollbar option.
Solution:   use dict_get_bool(). (closes #7029)
This commit is contained in:
Bram Moolenaar 2020-09-27 21:16:45 +02:00
parent d0e1b7103c
commit 6c542f77eb
3 changed files with 21 additions and 15 deletions

View File

@ -665,9 +665,9 @@ apply_general_options(win_T *wp, dict_T *dict)
wp->w_firstline = -1; wp->w_firstline = -1;
} }
di = dict_find(dict, (char_u *)"scrollbar", -1); nr = dict_get_bool(dict, (char_u *)"scrollbar", -1);
if (di != NULL) if (nr != -1)
wp->w_want_scrollbar = dict_get_number(dict, (char_u *)"scrollbar"); wp->w_want_scrollbar = nr;
str = dict_get_string(dict, (char_u *)"title", FALSE); str = dict_get_string(dict, (char_u *)"title", FALSE);
if (str != NULL) if (str != NULL)

View File

@ -2168,6 +2168,21 @@ func Test_popup_scrollbar()
endif endif
endfunc 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() func PopupScroll()
call popup_clear() call popup_clear()
let text =<< trim END 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
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 END
call popup_create(text, #{ call CreatePopup(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')
\ })
endfunc endfunc
map <silent> <F3> :call test_setmouse(5, 36)<CR> map <silent> <F3> :call test_setmouse(5, 36)<CR>
map <silent> <F4> :call test_setmouse(4, 42)<CR> map <silent> <F4> :call test_setmouse(4, 42)<CR>

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1763,
/**/ /**/
1762, 1762,
/**/ /**/