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)
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 1a4ed1a..24e2ed9 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -3102,6 +3102,22 @@
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
endfunc