From 60895f3e36def9beb7d5463e792e5154ad9a7a0a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 12 Apr 2022 14:23:19 +0100 Subject: [PATCH] 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. --- runtime/syntax/synload.vim | 2 +- runtime/syntax/syntax.vim | 3 ++- src/ex_docmd.c | 9 +++++++-- src/structs.h | 3 ++- src/testdir/test_excmd.vim | 8 +++++--- src/version.c | 2 ++ 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/runtime/syntax/synload.vim b/runtime/syntax/synload.vim index f373161c7c..728b653d8e 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 f274d93f4f..4cb02887a1 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 42824d7bb4..ceb500dc13 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 + * "