To: vim_dev@googlegroups.com Subject: Patch 8.2.1423 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1423 Problem: Vim9: find global function when looking for script-local. Solution: Don't strip prefix if name starts with "s:". (closes #6688) Files: src/userfunc.c, src/testdir/test_vim9_func.vim *** ../vim-8.2.1422/src/userfunc.c 2020-08-10 22:40:53.322652515 +0200 --- src/userfunc.c 2020-08-11 22:29:59.267852701 +0200 *************** *** 2132,2139 **** char_u *p = untrans_function_name(rfname); // If using Vim9 script try not local to the script. ! // TODO: should not do this if the name started with "s:". ! if (p != NULL) fp = find_func(p, is_global, NULL); } --- 2132,2139 ---- char_u *p = untrans_function_name(rfname); // If using Vim9 script try not local to the script. ! // Don't do this if the name starts with "s:". ! if (p != NULL && (funcname[0] != 's' || funcname[1] != ':')) fp = find_func(p, is_global, NULL); } *** ../vim-8.2.1422/src/testdir/test_vim9_func.vim 2020-08-08 16:47:26.555257199 +0200 --- src/testdir/test_vim9_func.vim 2020-08-11 22:29:17.107933984 +0200 *************** *** 203,208 **** --- 203,217 ---- assert_equal('local', Func()) END CheckScriptSuccess(lines) + + lines =<< trim END + vim9script + def g:Funcy() + echo 'funcy' + enddef + s:Funcy() + END + CheckScriptFailure(lines, 'E117:') enddef func TakesOneArg(arg) *** ../vim-8.2.1422/src/version.c 2020-08-11 21:58:12.585968185 +0200 --- src/version.c 2020-08-11 22:21:42.377500606 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1423, /**/ -- If Microsoft would build a car... ... the oil, water temperature, and alternator warning lights would all be replaced by a single "General Protection Fault" warning light. /// 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 ///