Mercurial > vim
diff src/testdir/test_quickfix.vim @ 27457:4c16acb2525f v8.2.4257
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Commit: https://github.com/vim/vim/commit/62aec93bfdb9e1b40d03a6d2e8e9511f8b1bdb2d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 29 21:45:34 2022 +0000
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Problem: Vim9: finding global function without g: prefix but not finding
global variable is inconsistent.
Solution: Require using g: for a global function. Change the vim9.vim
script into a Vim9 script with exports. Fix that import in legacy
script does not work.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 29 Jan 2022 23:00:05 +0100 |
parents | b531c26f728b |
children | b8a5de86e9d1 |
line wrap: on
line diff
--- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -1,7 +1,7 @@ " Test for the quickfix feature. source check.vim -source vim9.vim +import './vim9.vim' as v9 CheckFeature quickfix source screendump.vim @@ -5347,7 +5347,7 @@ func Test_qftextfunc_callback() cclose #" Test for using a lambda function with set - VAR optval = "LSTART a LMIDDLE Tqfexpr(a) LEND" + VAR optval = "LSTART a LMIDDLE g:Tqfexpr(a) LEND" LET optval = substitute(optval, ' ', '\\ ', 'g') exe "set qftf=" .. optval cexpr "F6:6:6:L6" @@ -5356,21 +5356,21 @@ func Test_qftextfunc_callback() cclose #" Set 'quickfixtextfunc' to a lambda expression - LET &qftf = LSTART a LMIDDLE Tqfexpr(a) LEND + LET &qftf = LSTART a LMIDDLE g:Tqfexpr(a) LEND cexpr "F7:7:7:L7" copen call assert_equal('F7-L7C7-L7', getline(1)) cclose #" Set 'quickfixtextfunc' to string(lambda_expression) - LET &qftf = "LSTART a LMIDDLE Tqfexpr(a) LEND" + LET &qftf = "LSTART a LMIDDLE g:Tqfexpr(a) LEND" cexpr "F8:8:8:L8" copen call assert_equal('F8-L8C8-L8', getline(1)) cclose #" Set 'quickfixtextfunc' to a variable with a lambda expression - VAR Lambda = LSTART a LMIDDLE Tqfexpr(a) LEND + VAR Lambda = LSTART a LMIDDLE g:Tqfexpr(a) LEND LET &qftf = Lambda cexpr "F9:9:9:L9" copen @@ -5378,14 +5378,14 @@ func Test_qftextfunc_callback() cclose #" Set 'quickfixtextfunc' to a string(variable with a lambda expression) - LET Lambda = LSTART a LMIDDLE Tqfexpr(a) LEND + LET Lambda = LSTART a LMIDDLE g:Tqfexpr(a) LEND LET &qftf = string(Lambda) cexpr "F9:9:9:L9" copen call assert_equal('F9-L9C9-L9', getline(1)) cclose END - call CheckLegacyAndVim9Success(lines) + call v9.CheckLegacyAndVim9Success(lines) " Test for using a script-local function name func s:TqfFunc2(info)