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.
60895f3e36

Most code changes has already been ported.
This commit is contained in:
zeertzjq
2022-08-23 13:03:00 +08:00
parent a9e6cf0e64
commit 7afc17dec1
4 changed files with 21 additions and 17 deletions

View File

@@ -30,7 +30,7 @@ fun! s:SynSet()
unlet b:current_syntax unlet b:current_syntax
endif endif
let s = expand("<amatch>") 0verbose let s = expand("<amatch>")
if s == "ON" if s == "ON"
" :set syntax=ON " :set syntax=ON
if &filetype == "" if &filetype == ""

View File

@@ -28,8 +28,9 @@ endif
" Set up the connection between FileType and Syntax autocommands. " Set up the connection between FileType and Syntax autocommands.
" This makes the syntax automatically set when the file type is detected. " This makes the syntax automatically set when the file type is detected.
" Avoid an error when 'verbose' is set and <amatch> expansion fails.
augroup syntaxset augroup syntaxset
au! FileType * exe "set syntax=" . expand("<amatch>") au! FileType * 0verbose exe "set syntax=" . expand("<amatch>")
augroup END augroup END

View File

@@ -6617,18 +6617,19 @@ ssize_t find_cmdline_var(const char_u *src, size_t *usedlen)
/// Evaluate cmdline variables. /// Evaluate cmdline variables.
/// ///
/// change '%' to curbuf->b_ffname /// change "%" to curbuf->b_ffname
/// '#' to curwin->w_alt_fnum /// "#" to curwin->w_alt_fnum
/// '<cword>' to word under the cursor /// "<cword>" to word under the cursor
/// '<cWORD>' to WORD under the cursor /// "<cWORD>" to WORD under the cursor
/// '<cexpr>' to C-expression under the cursor /// "<cexpr>" to C-expression under the cursor
/// '<cfile>' to path name under the cursor /// "<cfile>" to path name under the cursor
/// '<sfile>' to sourced file name /// "<sfile>" to sourced file name
/// '<stack>' to call stack /// "<stack>" to call stack
/// '<slnum>' to sourced file line number /// "<script>" to current script name
/// '<afile>' to file name for autocommand /// "<slnum>" to sourced file line number
/// '<abuf>' to buffer number for autocommand /// "<afile>" to file name for autocommand
/// '<amatch>' to matching name for autocommand /// "<abuf>" to buffer number for autocommand
/// "<amatch>" to matching name for autocommand
/// ///
/// When an error is detected, "errormsg" is set to a non-NULL pointer (may be /// When an error is detected, "errormsg" is set to a non-NULL pointer (may be
/// "" for error without a message) and NULL is returned. /// "" for error without a message) and NULL is returned.

View File

@@ -568,10 +568,12 @@ endfunc
" Test for the :verbose command " Test for the :verbose command
func Test_verbose_cmd() func Test_verbose_cmd()
call assert_equal([' verbose=1'], split(execute('verbose set vbs'), "\n")) set verbose=3
call assert_match(' verbose=1\n\s*Last set from ', execute('verbose set vbs'), "\n")
call assert_equal([' verbose=0'], split(execute('0verbose set vbs'), "\n")) call assert_equal([' verbose=0'], split(execute('0verbose set vbs'), "\n"))
let l = execute("4verbose set verbose | set verbose") set verbose=0
call assert_equal([' verbose=4', ' verbose=0'], split(l, "\n")) call assert_match(' verbose=4\n\s*Last set from .*\n verbose=0',
\ execute("4verbose set verbose | set verbose"))
endfunc endfunc
" Test for the :delete command and the related abbreviated commands " Test for the :delete command and the related abbreviated commands