diff --git a/runtime/syntax/synload.vim b/runtime/syntax/synload.vim index b88cd95103..056e38bf79 100644 --- a/runtime/syntax/synload.vim +++ b/runtime/syntax/synload.vim @@ -30,7 +30,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 ac7dc314b9..55a2ee6d71 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/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index ac2a65844f..7ed28e823e 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -6617,18 +6617,19 @@ ssize_t find_cmdline_var(const char_u *src, size_t *usedlen) /// Evaluate cmdline variables. /// -/// change '%' to curbuf->b_ffname -/// '#' to curwin->w_alt_fnum -/// '' to word under the cursor -/// '' to WORD under the cursor -/// '' to C-expression under the cursor -/// '' to path name under the cursor -/// '' to sourced file name -/// '' to call stack -/// '' to sourced file line number -/// '' to file name for autocommand -/// '' to buffer number for autocommand -/// '' to matching name for autocommand +/// change "%" to curbuf->b_ffname +/// "#" to curwin->w_alt_fnum +/// "" to word under the cursor +/// "" to WORD under the cursor +/// "" to C-expression under the cursor +/// "" to path name under the cursor +/// "" to sourced file name +/// "" to call stack +/// "