diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-01-25 15:31:28 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-01-25 15:31:28 +0000 |
commit | 01d4efe2e87632aa085897d3d64e27585908f977 (patch) | |
tree | caf031d3bcea34473aa163f6e7b878add52ba92e /src/testdir/test_edit.vim | |
parent | b0d45ec67f4976318f199a7929ad3bcf93686fd0 (diff) |
patch 9.0.1243: :setglobal cannot use script-local function for "expr" optionv9.0.1243
Problem: :setglobal cannot use script-local function for "expr" option.
Solution: Use the pointer to the option value properly. (closes #11883)
Diffstat (limited to 'src/testdir/test_edit.vim')
-rw-r--r-- | src/testdir/test_edit.vim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim index a70bc45d9c..ec824b077a 100644 --- a/src/testdir/test_edit.vim +++ b/src/testdir/test_edit.vim @@ -330,8 +330,23 @@ func Test_edit_11_indentexpr() endfunc set indentexpr=s:NewIndentExpr() call assert_equal(expand('<SID>') .. 'NewIndentExpr()', &indentexpr) + call assert_equal(expand('<SID>') .. 'NewIndentExpr()', &g:indentexpr) set indentexpr=<SID>NewIndentExpr() call assert_equal(expand('<SID>') .. 'NewIndentExpr()', &indentexpr) + call assert_equal(expand('<SID>') .. 'NewIndentExpr()', &g:indentexpr) + setlocal indentexpr= + setglobal indentexpr=s:NewIndentExpr() + call assert_equal(expand('<SID>') .. 'NewIndentExpr()', &g:indentexpr) + call assert_equal('', &indentexpr) + new + call assert_equal(expand('<SID>') .. 'NewIndentExpr()', &indentexpr) + bw! + setglobal indentexpr=<SID>NewIndentExpr() + call assert_equal(expand('<SID>') .. 'NewIndentExpr()', &g:indentexpr) + call assert_equal('', &indentexpr) + new + call assert_equal(expand('<SID>') .. 'NewIndentExpr()', &indentexpr) + bw! set indentexpr& bw! |