diff src/ex_docmd.c @ 21471:126dcb0411ed v8.2.1286

patch 8.2.1286: Vim9: No error when using a type to a window variable Commit: https://github.com/vim/vim/commit/43e969d3f98766824c18d20b84f2fab00feef683 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jul 23 21:14:43 2020 +0200 patch 8.2.1286: Vim9: No error when using a type to a window variable Problem: Vim9: No error when using a type to a window variable Solution: Recognize the syntax and give an error. (closes https://github.com/vim/vim/issues/6521)
author Bram Moolenaar <Bram@vim.org>
date Thu, 23 Jul 2020 21:15:05 +0200
parents 4dfd00f481fb
children eec2d2120cde
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -3324,6 +3324,14 @@ find_ex_command(
 		return eap->cmd;
 	    }
 	}
+
+	// Recognize using a type for a w:, b:, t: or g: variable:
+	// "w:varname: number = 123".
+	if (eap->cmd[1] == ':' && *p == ':')
+	{
+	    eap->cmdidx = CMD_eval;
+	    return eap->cmd;
+	}
     }
 #endif