changeset 30954:3e8aed429cc5 v9.0.0811

patch 9.0.0811: error if :echowin is preceded by a command modifier Commit: https://github.com/vim/vim/commit/2435adf8eb13736e2b3d012bb70df9ef960ffd60 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Oct 21 12:05:46 2022 +0100 patch 9.0.0811: error if :echowin is preceded by a command modifier 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)
author Bram Moolenaar <Bram@vim.org>
date Fri, 21 Oct 2022 13:15:03 +0200
parents e0b47ccd75a4
children 9d51e019ffd7
files src/testdir/test_vim9_script.vim src/version.c src/vim9compile.c
diffstat 3 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -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
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    811,
+/**/
     810,
 /**/
     809,
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -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;