0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.5088: value of cmod_verbose is a bit complicated to use

Problem:    Value of cmod_verbose is a bit complicated to use.
Solution:   Use zero for not set, value + 1 when set. (closes #10564)
This commit is contained in:
zeertzjq
2022-06-14 13:30:35 +01:00
committed by Bram Moolenaar
parent 1630bd980a
commit cd7496382e
5 changed files with 11 additions and 11 deletions

View File

@@ -3089,12 +3089,11 @@ parse_command_modifiers(
break;
if (vim_isdigit(*eap->cmd))
{
cmod->cmod_verbose = atoi((char *)eap->cmd);
if (cmod->cmod_verbose == 0)
cmod->cmod_verbose = -1;
// zero means not set, one is verbose == 0, etc.
cmod->cmod_verbose = atoi((char *)eap->cmd) + 1;
}
else
cmod->cmod_verbose = 1;
cmod->cmod_verbose = 2; // default: verbose == 1
eap->cmd = p;
continue;
}
@@ -3147,7 +3146,7 @@ has_cmdmod(cmdmod_T *cmod, int ignore_silent)
|| (cmod->cmod_flags
& ~(CMOD_SILENT | CMOD_ERRSILENT | CMOD_UNSILENT)) != 0))
|| cmod->cmod_split != 0
|| cmod->cmod_verbose != 0
|| cmod->cmod_verbose > 0
|| cmod->cmod_tab != 0
|| cmod->cmod_filter_regmatch.regprog != NULL;
}
@@ -3182,11 +3181,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 < 0 ? 0 : cmod->cmod_verbose;
p_verbose = cmod->cmod_verbose - 1;
}
if ((cmod->cmod_flags & (CMOD_SILENT | CMOD_UNSILENT))

View File

@@ -256,7 +256,6 @@ do_incsearch_highlighting(
ea.cmd = ccline.cmdbuff;
ea.addr_type = ADDR_LINES;
CLEAR_FIELD(dummy_cmdmod);
parse_command_modifiers(&ea, &dummy, &dummy_cmdmod, TRUE);
cmd = skip_range(ea.cmd, TRUE, NULL);

View File

@@ -1291,7 +1291,7 @@ EXTERN pos_T last_cursormoved // for CursorMoved event
EXTERN int postponed_split INIT(= 0); // for CTRL-W CTRL-] command
EXTERN int postponed_split_flags INIT(= 0); // args for win_split()
EXTERN int postponed_split_tab INIT(= 0); // cmdmod.tab
EXTERN int postponed_split_tab INIT(= 0); // cmdmod.cmod_tab
#ifdef FEAT_QUICKFIX
EXTERN int g_do_tagpreview INIT(= 0); // for tag preview commands:
// height of preview window

View File

@@ -662,8 +662,8 @@ typedef struct
regmatch_T cmod_filter_regmatch; // set by :filter /pat/
int cmod_filter_force; // set for :filter!
int cmod_verbose; // non-zero to set 'verbose', -1 is
// used for zero override
int cmod_verbose; // 0 if not set, > 0 to set 'verbose'
// to cmod_verbose - 1
// values for undo_cmdmod()
char_u *cmod_save_ei; // saved value of 'eventignore'

View File

@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
5088,
/**/
5087,
/**/