From: Bram Moolenaar Date: Tue, 12 Apr 2022 13:23:19 +0000 (+0100) Subject: patch 8.2.4741: startup test fails X-Git-Tag: v8.2.4741 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=60895f3e36def9beb7d5463e792e5154ad9a7a0a;p=vim patch 8.2.4741: startup test fails Problem: Startup test fails. Solution: Avoid an error for verbose expansion. Fix that the "0verbose" command modifier doesn't work. --- diff --git a/runtime/syntax/synload.vim b/runtime/syntax/synload.vim index f373161c7..728b653d8 100644 --- a/runtime/syntax/synload.vim +++ b/runtime/syntax/synload.vim @@ -37,7 +37,7 @@ fun! s:SynSet() unlet b:current_syntax endif - let s = expand("") + 0verbose let s = expand("") if s == "ON" " :set syntax=ON if &filetype == "" diff --git a/runtime/syntax/syntax.vim b/runtime/syntax/syntax.vim index f274d93f4..4cb02887a 100644 --- a/runtime/syntax/syntax.vim +++ b/runtime/syntax/syntax.vim @@ -28,8 +28,9 @@ endif " Set up the connection between FileType and Syntax autocommands. " This makes the syntax automatically set when the file type is detected. +" Avoid an error when 'verbose' is set and expansion fails. augroup syntaxset - au! FileType * exe "set syntax=" . expand("") + au! FileType * 0verbose exe "set syntax=" . expand("") augroup END diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 42824d7bb..ceb500dc1 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -3084,7 +3084,11 @@ parse_command_modifiers( if (!checkforcmd_noparen(&p, "verbose", 4)) break; if (vim_isdigit(*eap->cmd)) + { cmod->cmod_verbose = atoi((char *)eap->cmd); + if (cmod->cmod_verbose == 0) + cmod->cmod_verbose = -1; + } else cmod->cmod_verbose = 1; eap->cmd = p; @@ -3158,11 +3162,11 @@ apply_cmdmod(cmdmod_T *cmod) cmod->cmod_did_sandbox = TRUE; } #endif - if (cmod->cmod_verbose > 0) + if (cmod->cmod_verbose != 0) { if (cmod->cmod_verbose_save == 0) cmod->cmod_verbose_save = p_verbose + 1; - p_verbose = cmod->cmod_verbose; + p_verbose = cmod->cmod_verbose < 0 ? 0 : cmod->cmod_verbose; } if ((cmod->cmod_flags & (CMOD_SILENT | CMOD_UNSILENT)) @@ -8999,6 +9003,7 @@ find_cmdline_var(char_u *src, int *usedlen) * "" to path name under the cursor * "" to sourced file name * "" to call stack + * "