diff src/ex_docmd.c @ 30217:e0cb5fb44859 v9.0.0444

patch 9.0.0444: trying to declare g:variable gives confusing error Commit: https://github.com/vim/vim/commit/9510d22463055f56548ff461ccbc54caa1ba1a2f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 11 15:14:05 2022 +0100 patch 9.0.0444: trying to declare g:variable gives confusing error Problem: Trying to declare g:variable gives confusing error. Solution: Give a better error message. (closes https://github.com/vim/vim/issues/11108)
author Bram Moolenaar <Bram@vim.org>
date Sun, 11 Sep 2022 16:15:04 +0200
parents 3564cddda2a5
children 121d28008c14
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -3761,11 +3761,11 @@ find_ex_command(
 		}
 	    }
 
-	    // Recognize using a type for a w:, b:, t: or g: variable:
+	    // Recognize trying to use a type for a w:, b:, t: or g: variable:
 	    // "w:varname: number = 123".
 	    if (eap->cmd[1] == ':' && *p == ':')
 	    {
-		eap->cmdidx = CMD_eval;
+		eap->cmdidx = CMD_var;
 		return eap->cmd;
 	    }
 	}