1
0
forked from aniani/vim

patch 8.2.5053: cannot have a comment halfway an expression in a block

Problem:    Cannot have a comment halfway an expression in an autocmd command
            block.
Solution:   When skipping over the NL also skip over comments. (closes #10519)
This commit is contained in:
Bram Moolenaar
2022-06-03 17:39:46 +01:00
parent bfaa24f953
commit 75ebd2aab0
3 changed files with 49 additions and 2 deletions

View File

@@ -3100,6 +3100,22 @@ func Test_autocmd_with_block()
call assert_equal(77, g:gotSafeState)
unlet g:gotSafeState
augroup block_testing
au!
autocmd CursorHold * {
if true
# comment
&& true
&& true
g:done = 'yes'
endif
}
augroup END
doautocmd CursorHold
call assert_equal('yes', g:done)
unlet g:done
augroup block_testing
au!
augroup END