summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_gui.vim
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2021-12-26 10:51:39 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-26 10:51:39 +0000
commit8bb65f230d3025037f34021a72616038da0601ee (patch)
tree1edaf57b7fbe5e3c30a174026f5389f8b98b7376 /src/testdir/test_gui.vim
parentec86520f946a40d5c4a92d6a11d6928faa13abd4 (diff)
patch 8.2.3900: it is not easy to use a script-local function for an optionv8.2.3900
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)
Diffstat (limited to 'src/testdir/test_gui.vim')
-rw-r--r--src/testdir/test_gui.vim9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim
index 133298db3a..90552843d1 100644
--- a/src/testdir/test_gui.vim
+++ b/src/testdir/test_gui.vim
@@ -258,6 +258,15 @@ func Test_set_balloonexpr()
setl balloonexpr&
call assert_equal('', &balloonexpr)
delfunc MyBalloonExpr
+
+ " Using a script-local function
+ func s:NewBalloonExpr()
+ endfunc
+ set balloonexpr=s:NewBalloonExpr()
+ call assert_equal(expand('<SID>') .. 'NewBalloonExpr()', &balloonexpr)
+ set balloonexpr=<SID>NewBalloonExpr()
+ call assert_equal(expand('<SID>') .. 'NewBalloonExpr()', &balloonexpr)
+ delfunc s:NewBalloonExpr
bwipe!
" Multiline support