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

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.
This commit is contained in:
Bram Moolenaar
2020-10-24 20:49:43 +02:00
parent 5661ed6c83
commit e100440158
38 changed files with 284 additions and 271 deletions

View File

@@ -775,7 +775,7 @@ diff_write(buf_T *buf, diffin_T *din)
{
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 @@ diff_write(buf_T *buf, diffin_T *din)
// 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 @@ ex_diffpatch(exarg_T *eap)
#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 @@ ex_diffpatch(exarg_T *eap)
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 @@ ex_diffpatch(exarg_T *eap)
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 @@ theend:
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 @@ ex_diffsplit(exarg_T *eap)
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)
{