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:
committed by
Bram Moolenaar
parent
ec86520f94
commit
8bb65f230d
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user