]> granicus.if.org Git - vim/commitdiff
patch 9.0.0811: error if :echowin is preceded by a command modifier v9.0.0811
authorBram Moolenaar <Bram@vim.org>
Fri, 21 Oct 2022 11:05:46 +0000 (12:05 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 21 Oct 2022 11:05:46 +0000 (12:05 +0100)
Problem:    Error if :echowin is preceded by a command modifier.
Solution:   Do not give an error for range when there is a modifier.
            (closes #11414)

src/testdir/test_vim9_script.vim
src/version.c
src/vim9compile.c

index 6c8f1f0ce0b0de46f4f9dbb2f72a064a3794d700..58e214c7b28b8c43152b45af31320d42f561f51f 100644 (file)
@@ -2032,6 +2032,10 @@ enddef
 def Test_echowindow_cmd()
   var local = 'local'
   echowindow 'something' local # comment
+
+  # with modifier
+  unsilent echowin 'loud'
+
   # output goes in message window
   popup_clear()
 enddef
index 4017c472074f8aaf4f2b0ff44bf6e23237572ae1..662835ebf80fb327c776b547806a2da9aa91f5fd 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    811,
 /**/
     810,
 /**/
index 73bfa6c6af1e20655175f4a6ae76bd0be022ee2f..fb66a788061f21e787f43ce7622aba2683e695bb 100644 (file)
@@ -2712,8 +2712,9 @@ get_cmd_count(char_u *line, exarg_T *eap)
        ;
     if (!isdigit(*p))
     {
-       // the command must be following
-       if (p < eap->cmd)
+       // The command or modifiers must be following.  Assume a lower case
+       // character means there is a modifier.
+       if (p < eap->cmd && !vim_islower(*p))
        {
            emsg(_(e_invalid_range));
            return -1;