1
0
forked from aniani/vim

patch 9.1.0994: Vim9: not able to use comment after opening curly brace

Problem:  Vim9: not able to use comment after opening curly brace
          (lifepillar)
Solution: allow to use comments after curly braces of an inner-block,
          modify the logic to search for comment in a line, update Vim9
          tests to use specific class type instead of any
          (Yegappan Lakshmanan)

fixes: #16363
closes: #16405

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yegappan Lakshmanan
2025-01-07 20:22:32 +01:00
committed by Christian Brabandt
parent c97e869535
commit 0072ceedc6
5 changed files with 149 additions and 16 deletions

View File

@@ -595,6 +595,27 @@ def Test_autocommand_block()
unlet g:otherVar
enddef
def Test_block_in_a_string()
var lines =<< trim END
vim9script
def Foo(): string
var x = ' => { # abc'
return x
enddef
assert_equal(' => { # abc', Foo())
def Bar(): string
var x = " => { # abc"
return x
enddef
assert_equal(" => { # abc", Bar())
END
v9.CheckSourceSuccess(lines)
enddef
func g:NoSuchFunc()
echo 'none'
endfunc