summaryrefslogtreecommitdiffstats
path: root/src/option.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/option.c b/src/option.c
index 12a0816f3d..51d6212462 100644
--- a/src/option.c
+++ b/src/option.c
@@ -6135,9 +6135,9 @@ set_string_option(
char_u *s;
char_u **varp;
char_u *oldval;
+#if defined(FEAT_EVAL)
char_u *oldval_l = NULL;
char_u *oldval_g = NULL;
-#if defined(FEAT_EVAL)
char_u *saved_oldval = NULL;
char_u *saved_oldval_l = NULL;
char_u *saved_oldval_g = NULL;
@@ -6158,6 +6158,7 @@ set_string_option(
? OPT_GLOBAL : OPT_LOCAL)
: opt_flags);
oldval = *varp;
+#if defined(FEAT_EVAL)
if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0)
{
oldval_l = *(char_u **)get_varp_scope(&(options[opt_idx]),
@@ -6165,6 +6166,7 @@ set_string_option(
oldval_g = *(char_u **)get_varp_scope(&(options[opt_idx]),
OPT_GLOBAL);
}
+#endif
*varp = s;
#if defined(FEAT_EVAL)
@@ -8525,7 +8527,9 @@ set_bool_option(
int opt_flags) /* OPT_LOCAL and/or OPT_GLOBAL */
{
int old_value = *(int *)varp;
+#if defined(FEAT_EVAL)
int old_global_value = 0;
+#endif
/* Disallow changing some options from secure mode */
if ((secure
@@ -8535,12 +8539,14 @@ set_bool_option(
) && (options[opt_idx].flags & P_SECURE))
return e_secure;
+#if defined(FEAT_EVAL)
// Save the global value before changing anything. This is needed as for
// a global-only option setting the "local value" in fact sets the global
// value (since there is only one value).
if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0)
old_global_value = *(int *)get_varp_scope(&(options[opt_idx]),
OPT_GLOBAL);
+#endif
*(int *)varp = value; /* set the new value */
#ifdef FEAT_EVAL
@@ -9130,8 +9136,10 @@ set_num_option(
{
char *errmsg = NULL;
long old_value = *(long *)varp;
+#if defined(FEAT_EVAL)
long old_global_value = 0; // only used when setting a local and
// global option
+#endif
long old_Rows = Rows; // remember old Rows
long old_Columns = Columns; // remember old Columns
long *pp = (long *)varp;
@@ -9144,11 +9152,14 @@ set_num_option(
) && (options[opt_idx].flags & P_SECURE))
return e_secure;
+#if defined(FEAT_EVAL)
// Save the global value before changing anything. This is needed as for
// a global-only option setting the "local value" infact sets the global
// value (since there is only one value).
if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0)
- old_global_value = *(long *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL);
+ old_global_value = *(long *)get_varp_scope(&(options[opt_idx]),
+ OPT_GLOBAL);
+#endif
*pp = value;
#ifdef FEAT_EVAL