patch 7.4.830
Problem: Resetting 'encoding' when doing ":set all&" causes problems.
(Bjorn Linse) Display is not updated.
Solution: Do not reset 'encoding'. Do a full redraw.
diff --git a/src/option.c b/src/option.c
index f3e4e20..08e2e59 100644
--- a/src/option.c
+++ b/src/option.c
@@ -3656,6 +3656,7 @@
/*
* Set all options (except terminal options) to their default value.
+ * When "opt_flags" is non-zero skip 'encoding'.
*/
static void
set_options_default(opt_flags)
@@ -3668,7 +3669,8 @@
#endif
for (i = 0; !istermoption(&options[i]); i++)
- if (!(options[i].flags & P_NODEFAULT))
+ if (!(options[i].flags & P_NODEFAULT)
+ && (opt_flags == 0 || options[i].var != (char_u *)&p_enc))
set_option_default(i, opt_flags, p_cp);
#ifdef FEAT_WINDOWS
@@ -4204,6 +4206,7 @@
++arg;
/* Only for :set command set global value of local options. */
set_options_default(OPT_FREE | opt_flags);
+ redraw_all_later(CLEAR);
}
else
{