To: vim_dev@googlegroups.com Subject: Patch 8.2.3405 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3405 Problem: Cannot have a comment line in a {} block of a user command. Solution: Continue after the line break. (closes #8837) Files: src/ex_docmd.c, src/testdir/test_usercommands.vim *** ../vim-8.2.3404/src/ex_docmd.c 2021-08-24 21:55:58.337276558 +0200 --- src/ex_docmd.c 2021-09-06 17:09:25.213508642 +0200 *************** *** 2807,2813 **** --- 2807,2822 ---- // ignore comment and empty lines if (comment_start(eap->cmd, starts_with_colon)) + { + // a comment ends at a NL + if (eap->nextcmd == NULL) + { + eap->nextcmd = vim_strchr(eap->cmd, '\n'); + if (eap->nextcmd != NULL) + ++eap->nextcmd; + } return FAIL; + } if (*eap->cmd == NUL) { if (!skip_only) *** ../vim-8.2.3404/src/testdir/test_usercommands.vim 2021-08-05 20:39:59.354053658 +0200 --- src/testdir/test_usercommands.vim 2021-09-06 15:58:59.701206689 +0200 *************** *** 624,630 **** func Test_usercmd_with_block() command DoSomething { ! g:didit = 'yes' g:didmore = 'more' } DoSomething --- 624,631 ---- func Test_usercmd_with_block() command DoSomething { ! g:didit = 'yes' # comment ! # comment line g:didmore = 'more' } DoSomething *** ../vim-8.2.3404/src/version.c 2021-09-05 16:36:20.239647841 +0200 --- src/version.c 2021-09-06 17:10:36.073372626 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3405, /**/ -- I learned the customs and mannerisms of engineers by observing them, much the way Jane Goodall learned about the great apes, but without the hassle of grooming. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///