diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-10-24 20:49:43 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-10-24 20:49:43 +0200 |
commit | e10044015841711b989f9a898d427bcc1fdb4c32 (patch) | |
tree | 256dbf4f826bbc408bb1eca2b381c4dc4f953eb6 /src/diff.c | |
parent | 5661ed6c833e05467cab33cb9b1c535e7e5cc570 (diff) |
patch 8.2.1898: command modifier parsing always uses global cmdmodv8.2.1898
Problem: Command modifier parsing always uses global cmdmod.
Solution: Pass in cmdmod_T to use. Rename struct fields consistently.
Diffstat (limited to 'src/diff.c')
-rw-r--r-- | src/diff.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/diff.c b/src/diff.c index bb95d5ed65..753d089b66 100644 --- a/src/diff.c +++ b/src/diff.c @@ -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) { |