summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-06-14 13:30:35 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-14 13:30:35 +0100
commitcd7496382efc9e6748326c6cda7f01003fa07063 (patch)
treecfb5592b4cb28fb3d302842bb71b6c141ba28f5b
parent1630bd980a1f7f62adc6f73cb20be66a3c382225 (diff)
patch 8.2.5088: value of cmod_verbose is a bit complicated to usev8.2.5088
Problem: Value of cmod_verbose is a bit complicated to use. Solution: Use zero for not set, value + 1 when set. (closes #10564)
-rw-r--r--src/ex_docmd.c13
-rw-r--r--src/ex_getln.c1
-rw-r--r--src/globals.h2
-rw-r--r--src/structs.h4
-rw-r--r--src/version.c2
5 files changed, 11 insertions, 11 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 9a06999e7c..a6f5952c1f 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -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))
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 20d9520ed1..8be971a885 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -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);
diff --git a/src/globals.h b/src/globals.h
index 7100dcd08d..63377af5b1 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -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
diff --git a/src/structs.h b/src/structs.h
index 7fe97fdbb3..9e40928141 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -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'
diff --git a/src/version.c b/src/version.c
index 47b5382fea..02600f7559 100644
--- a/src/version.c
+++ b/src/version.c
@@ -735,6 +735,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 5088,
+/**/
5087,
/**/
5086,