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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user