mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
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.
This commit is contained in:
@@ -37,7 +37,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 == ""
|
||||||
|
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
@@ -3084,7 +3084,11 @@ parse_command_modifiers(
|
|||||||
if (!checkforcmd_noparen(&p, "verbose", 4))
|
if (!checkforcmd_noparen(&p, "verbose", 4))
|
||||||
break;
|
break;
|
||||||
if (vim_isdigit(*eap->cmd))
|
if (vim_isdigit(*eap->cmd))
|
||||||
|
{
|
||||||
cmod->cmod_verbose = atoi((char *)eap->cmd);
|
cmod->cmod_verbose = atoi((char *)eap->cmd);
|
||||||
|
if (cmod->cmod_verbose == 0)
|
||||||
|
cmod->cmod_verbose = -1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
cmod->cmod_verbose = 1;
|
cmod->cmod_verbose = 1;
|
||||||
eap->cmd = p;
|
eap->cmd = p;
|
||||||
@@ -3158,11 +3162,11 @@ apply_cmdmod(cmdmod_T *cmod)
|
|||||||
cmod->cmod_did_sandbox = TRUE;
|
cmod->cmod_did_sandbox = TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (cmod->cmod_verbose > 0)
|
if (cmod->cmod_verbose != 0)
|
||||||
{
|
{
|
||||||
if (cmod->cmod_verbose_save == 0)
|
if (cmod->cmod_verbose_save == 0)
|
||||||
cmod->cmod_verbose_save = p_verbose + 1;
|
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))
|
if ((cmod->cmod_flags & (CMOD_SILENT | CMOD_UNSILENT))
|
||||||
@@ -8999,6 +9003,7 @@ find_cmdline_var(char_u *src, int *usedlen)
|
|||||||
* "<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
|
||||||
|
* "<script>" to current script name
|
||||||
* "<slnum>" to sourced file line number
|
* "<slnum>" to sourced file line number
|
||||||
* "<afile>" to file name for autocommand
|
* "<afile>" to file name for autocommand
|
||||||
* "<abuf>" to buffer number for autocommand
|
* "<abuf>" to buffer number for autocommand
|
||||||
|
@@ -662,7 +662,8 @@ typedef struct
|
|||||||
regmatch_T cmod_filter_regmatch; // set by :filter /pat/
|
regmatch_T cmod_filter_regmatch; // set by :filter /pat/
|
||||||
int cmod_filter_force; // set for :filter!
|
int cmod_filter_force; // set for :filter!
|
||||||
|
|
||||||
int cmod_verbose; // non-zero to set 'verbose'
|
int cmod_verbose; // non-zero to set 'verbose', -1 is
|
||||||
|
// used for zero override
|
||||||
|
|
||||||
// values for undo_cmdmod()
|
// values for undo_cmdmod()
|
||||||
char_u *cmod_save_ei; // saved value of 'eventignore'
|
char_u *cmod_save_ei; // saved value of 'eventignore'
|
||||||
|
@@ -580,10 +580,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
|
||||||
|
@@ -746,6 +746,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
4741,
|
||||||
/**/
|
/**/
|
||||||
4740,
|
4740,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user