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 -- b...@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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202109061511.186FBUiM1378019%40masaka.moolenaar.net.

Raspunde prin e-mail lui