To: vim_dev@googlegroups.com Subject: Patch 8.2.1763 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1763 Problem: Vim9: cannot use "true" for popup window scrollbar option. Solution: use dict_get_bool(). (closes #7029) Files: src/popupwin.c, src/testdir/test_popupwin.vim *** ../vim-8.2.1762/src/popupwin.c 2020-09-26 22:02:38.135641113 +0200 --- src/popupwin.c 2020-09-27 21:14:50.152282503 +0200 *************** *** 665,673 **** 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"); str = dict_get_string(dict, (char_u *)"title", FALSE); if (str != NULL) --- 665,673 ---- wp->w_firstline = -1; } ! 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) *** ../vim-8.2.1762/src/testdir/test_popupwin.vim 2020-09-26 22:02:38.135641113 +0200 --- src/testdir/test_popupwin.vim 2020-09-27 21:13:23.892457872 +0200 *************** *** 2168,2173 **** --- 2168,2188 ---- endif endfunc + def CreatePopup(text: list) + 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,2196 **** 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') ! \ }) endfunc map :call test_setmouse(5, 36) map :call test_setmouse(4, 42) --- 2194,2200 ---- 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 CreatePopup(text) endfunc map :call test_setmouse(5, 36) map :call test_setmouse(4, 42) *** ../vim-8.2.1762/src/version.c 2020-09-27 20:12:49.417331796 +0200 --- src/version.c 2020-09-27 21:15:48.060161409 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 1763, /**/ -- hundred-and-one symptoms of being an internet addict: 5. You find yourself brainstorming for new subjects to search. /// 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 ///