# HG changeset patch # User Bram Moolenaar # Date 1649770205 -7200 # Node ID 367439b95abaf06bef60e1b074203bf78b0039cd # Parent 5e295771ba24e4229b2ab339825bb57470e4fa95 patch 8.2.4741: startup test fails Commit: https://github.com/vim/vim/commit/60895f3e36def9beb7d5463e792e5154ad9a7a0a Author: Bram Moolenaar Date: Tue Apr 12 14:23:19 2022 +0100 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 --- 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 --- 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 --- 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 *usedl * "" to path name under the cursor * "" to sourced file name * "" to call stack + * "