diff src/diff.c @ 22699:e82579016863 v8.2.1898

patch 8.2.1898: command modifier parsing always uses global cmdmod Commit: https://github.com/vim/vim/commit/e10044015841711b989f9a898d427bcc1fdb4c32 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 24 20:49:43 2020 +0200 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.
author Bram Moolenaar <Bram@vim.org>
date Sat, 24 Oct 2020 21:00:05 +0200
parents 097f5b5c907b
children e313b6ee2d9c
line wrap: on
line diff
--- 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)
     {