diff src/vim9compile.c @ 20172:1d84eaed0ec8 v8.2.0641

patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include Commit: https://github.com/vim/vim/commit/6378c4fef37df05c99e8a43616063b4ddb692876 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 26 13:50:41 2020 +0200 patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include Problem: Vim9: not expanded in :hardcopy and "syntax include". Solution: Add the EX_EXPAND flag. Expend "syntax include".
author Bram Moolenaar <Bram@vim.org>
date Sun, 26 Apr 2020 14:00:04 +0200
parents 0612c64a2b87
children 72b437855299
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -5821,14 +5821,23 @@ compile_mult_expr(char_u *arg, int cmdid
     static char_u *
 compile_exec(char_u *line, exarg_T *eap, cctx_T *cctx)
 {
-    char_u *p;
+    char_u  *p;
+    int	    has_expr;
 
     if (cctx->ctx_skip == TRUE)
 	goto theend;
 
-
-    if ((excmd_get_argt(eap->cmdidx) & EX_XFILE)
-	    && (p = (char_u *)strstr((char *)eap->arg, "`=")) != NULL)
+    has_expr = (excmd_get_argt(eap->cmdidx) & (EX_XFILE | EX_EXPAND));
+    if (eap->cmdidx == CMD_syntax && STRNCMP(eap->arg, "include ", 8) == 0)
+    {
+	// expand filename in "syntax include [@group] filename"
+	has_expr = TRUE;
+	eap->arg = skipwhite(eap->arg + 7);
+	if (*eap->arg == '@')
+	    eap->arg = skiptowhite(eap->arg);
+    }
+
+    if (has_expr && (p = (char_u *)strstr((char *)eap->arg, "`=")) != NULL)
     {
 	int	count = 0;
 	char_u	*start = skipwhite(line);