1
0
forked from aniani/vim

patch 8.2.3900: it is not easy to use a script-local function for an option

Problem:    It is not easy to use a script-local function for an option.
Solution:   recognize s: and <SID> at the start of the expression. (Yegappan
            Lakshmanan, closes #9401)
This commit is contained in:
Yegappan Lakshmanan
2021-12-26 10:51:39 +00:00
committed by Bram Moolenaar
parent ec86520f94
commit 8bb65f230d
13 changed files with 265 additions and 8 deletions

View File

@@ -324,6 +324,16 @@ func Test_edit_11_indentexpr()
set cinkeys&vim indentkeys&vim
set nocindent indentexpr=
delfu Do_Indent
" Using a script-local function
func s:NewIndentExpr()
endfunc
set indentexpr=s:NewIndentExpr()
call assert_equal(expand('<SID>') .. 'NewIndentExpr()', &indentexpr)
set indentexpr=<SID>NewIndentExpr()
call assert_equal(expand('<SID>') .. 'NewIndentExpr()', &indentexpr)
set indentexpr&
bw!
endfunc