comparison src/testdir/test_gui.vim @ 26743:c2c40cefc17b v8.2.3900

patch 8.2.3900: it is not easy to use a script-local function for an option Commit: https://github.com/vim/vim/commit/8bb65f230d3025037f34021a72616038da0601ee Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sun Dec 26 10:51:39 2021 +0000 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)
author Bram Moolenaar <Bram@vim.org>
date Sun, 26 Dec 2021 12:00:04 +0100
parents be2d004247e1
children 722db0819111
comparison
equal deleted inserted replaced
26742:00732e690ee8 26743:c2c40cefc17b
256 " and check if the content of the balloon is the same as what is expected. 256 " and check if the content of the balloon is the same as what is expected.
257 " Also, check if textlock works as expected. 257 " Also, check if textlock works as expected.
258 setl balloonexpr& 258 setl balloonexpr&
259 call assert_equal('', &balloonexpr) 259 call assert_equal('', &balloonexpr)
260 delfunc MyBalloonExpr 260 delfunc MyBalloonExpr
261
262 " Using a script-local function
263 func s:NewBalloonExpr()
264 endfunc
265 set balloonexpr=s:NewBalloonExpr()
266 call assert_equal(expand('<SID>') .. 'NewBalloonExpr()', &balloonexpr)
267 set balloonexpr=<SID>NewBalloonExpr()
268 call assert_equal(expand('<SID>') .. 'NewBalloonExpr()', &balloonexpr)
269 delfunc s:NewBalloonExpr
261 bwipe! 270 bwipe!
262 271
263 " Multiline support 272 " Multiline support
264 if has('balloon_multiline') 273 if has('balloon_multiline')
265 " Multiline balloon using NL 274 " Multiline balloon using NL