To: vim_dev@googlegroups.com Subject: Patch 8.2.3596 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3596 Problem: Crash when using :pedit in Vim9 script. Solution: Move check for arguments to after checking there are arguments. (Yegappan Lakshmanan, closes #9134, closes #9135) Files: src/popupwin.c, src/testdir/test_vim9_cmd.vim *** ../vim-8.2.3595/src/popupwin.c 2021-08-07 12:08:42.465099997 +0100 --- src/popupwin.c 2021-11-15 11:12:22.900271977 +0000 *************** *** 1851,1863 **** int nr; int i; - if (in_vim9script() - && (check_for_string_or_number_or_list_arg(argvars, 0) == FAIL - || check_for_dict_arg(argvars, 1) == FAIL)) - return NULL; - if (argvars != NULL) { // Check that arguments look OK. if (argvars[0].v_type == VAR_NUMBER) { --- 1851,1863 ---- int nr; int i; if (argvars != NULL) { + if (in_vim9script() + && (check_for_string_or_number_or_list_arg(argvars, 0) == FAIL + || check_for_dict_arg(argvars, 1) == FAIL)) + return NULL; + // Check that arguments look OK. if (argvars[0].v_type == VAR_NUMBER) { *** ../vim-8.2.3595/src/testdir/test_vim9_cmd.vim 2021-10-14 16:53:37.417505210 +0100 --- src/testdir/test_vim9_cmd.vim 2021-11-15 11:18:21.731663475 +0000 *************** *** 1570,1574 **** --- 1570,1585 ---- CheckDefExecAndScriptFailure(lines, 'E486:', 1) enddef + " Test for the 'popuppreview' option + def Test_popuppreview() + set previewpopup=height:10,width:60 + pedit Xfile + var id = popup_findpreview() + assert_notequal(id, 0) + assert_match('Xfile', popup_getoptions(id).title) + popup_clear() + set previewpopup& + enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker *** ../vim-8.2.3595/src/version.c 2021-11-14 14:05:14.817052501 +0000 --- src/version.c 2021-11-15 11:21:33.291333039 +0000 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 3596, /**/ -- WOMAN: King of the who? ARTHUR: The Britons. WOMAN: Who are the Britons? ARTHUR: Well, we all are. we're all Britons and I am your king. The Quest for the Holy Grail (Monty Python) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///