patch 8.2.1898: command modifier parsing always uses global cmdmod
Problem: Command modifier parsing always uses global cmdmod.
Solution: Pass in cmdmod_T to use. Rename struct fields consistently.
diff --git a/src/diff.c b/src/diff.c
index bb95d5e..753d089 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -775,7 +775,7 @@
{
int r;
char_u *save_ff;
- int save_lockmarks;
+ int save_cmod_flags;
if (din->din_fname == NULL)
return diff_write_buffer(buf, din);
@@ -783,14 +783,14 @@
// Always use 'fileformat' set to "unix".
save_ff = buf->b_p_ff;
buf->b_p_ff = vim_strsave((char_u *)FF_UNIX);
- save_lockmarks = cmdmod.lockmarks;
+ save_cmod_flags = cmdmod.cmod_flags;
// Writing the buffer is an implementation detail of performing the diff,
// so it shouldn't update the '[ and '] marks.
- cmdmod.lockmarks = TRUE;
+ cmdmod.cmod_flags |= CMOD_LOCKMARKS;
r = buf_write(buf, din->din_fname, NULL,
(linenr_T)1, buf->b_ml.ml_line_count,
NULL, FALSE, FALSE, FALSE, TRUE);
- cmdmod.lockmarks = save_lockmarks;
+ cmdmod.cmod_flags = save_cmod_flags;
free_string_option(buf->b_p_ff);
buf->b_p_ff = save_ff;
return r;
@@ -1187,13 +1187,13 @@
#endif
#ifdef FEAT_BROWSE
char_u *browseFile = NULL;
- int browse_flag = cmdmod.browse;
+ int save_cmod_flags = cmdmod.cmod_flags;
#endif
stat_T st;
char_u *esc_name = NULL;
#ifdef FEAT_BROWSE
- if (cmdmod.browse)
+ if (cmdmod.cmod_flags & CMOD_BROWSE)
{
browseFile = do_browse(0, (char_u *)_("Patch file"),
eap->arg, NULL, NULL,
@@ -1201,7 +1201,7 @@
if (browseFile == NULL)
return; // operation cancelled
eap->arg = browseFile;
- cmdmod.browse = FALSE; // don't let do_ecmd() browse again
+ cmdmod.cmod_flags &= ~CMOD_BROWSE; // don't let do_ecmd() browse again
}
#endif
@@ -1310,7 +1310,7 @@
need_mouse_correct = TRUE;
#endif
// don't use a new tab page, each tab page has its own diffs
- cmdmod.tab = 0;
+ cmdmod.cmod_tab = 0;
if (win_split(0, (diff_flags & DIFF_VERTICAL) ? WSP_VERT : 0) != FAIL)
{
@@ -1355,7 +1355,7 @@
vim_free(esc_name);
#ifdef FEAT_BROWSE
vim_free(browseFile);
- cmdmod.browse = browse_flag;
+ cmdmod.cmod_flags = save_cmod_flags;
#endif
}
@@ -1377,7 +1377,7 @@
set_fraction(curwin);
// don't use a new tab page, each tab page has its own diffs
- cmdmod.tab = 0;
+ cmdmod.cmod_tab = 0;
if (win_split(0, (diff_flags & DIFF_VERTICAL) ? WSP_VERT : 0) != FAIL)
{