#define P_RCLR 0x7000 /* clear and redraw all */
#define P_COMMA 0x8000 /* comma separated list */
-#define P_NODUP 0x10000L/* don't allow duplicate strings */
-#define P_FLAGLIST 0x20000L/* list of single-char flags */
-
-#define P_SECURE 0x40000L/* cannot change in modeline or secure mode */
-#define P_GETTEXT 0x80000L/* expand default value with _() */
-#define P_NOGLOB 0x100000L/* do not use local value for global vimrc */
-#define P_NFNAME 0x200000L/* only normal file name chars allowed */
-#define P_INSECURE 0x400000L/* option was set from a modeline */
-#define P_PRI_MKRC 0x800000L/* priority for :mkvimrc (setting option has
+#define P_NODUP 0x10000L /* don't allow duplicate strings */
+#define P_FLAGLIST 0x20000L /* list of single-char flags */
+
+#define P_SECURE 0x40000L /* cannot change in modeline or secure mode */
+#define P_GETTEXT 0x80000L /* expand default value with _() */
+#define P_NOGLOB 0x100000L /* do not use local value for global vimrc */
+#define P_NFNAME 0x200000L /* only normal file name chars allowed */
+#define P_INSECURE 0x400000L /* option was set from a modeline */
+#define P_PRI_MKRC 0x800000L /* priority for :mkvimrc (setting option has
side effects) */
-#define P_NO_ML 0x1000000L/* not allowed in modeline */
+#define P_NO_ML 0x1000000L /* not allowed in modeline */
+#define P_CURSWANT 0x2000000L /* update curswant required; not needed when
+ * there is a redraw flag */
#define ISK_LATIN1 (char_u *)"@,48-57,_,192-255"
#endif
options[] =
{
- {"aleph", "al", P_NUM|P_VI_DEF,
+ {"aleph", "al", P_NUM|P_VI_DEF|P_CURSWANT,
#ifdef FEAT_RIGHTLEFT
(char_u *)&p_aleph, PV_NONE,
#else
{(char_u *)FALSE, (char_u *)FALSE}
#endif
SCRIPTID_INIT},
- {"arabic", "arab", P_BOOL|P_VI_DEF|P_VIM,
+ {"arabic", "arab", P_BOOL|P_VI_DEF|P_VIM|P_CURSWANT,
#ifdef FEAT_ARABIC
(char_u *)VAR_WIN, PV_ARAB,
#else
{"columns", "co", P_NUM|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RCLR,
(char_u *)&Columns, PV_NONE,
{(char_u *)80L, (char_u *)0L} SCRIPTID_INIT},
- {"comments", "com", P_STRING|P_ALLOCED|P_VI_DEF|P_COMMA|P_NODUP,
+ {"comments", "com", P_STRING|P_ALLOCED|P_VI_DEF|P_COMMA|P_NODUP|P_CURSWANT,
#ifdef FEAT_COMMENTS
(char_u *)&p_com, PV_COM,
{(char_u *)"s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-",
{(char_u *)0L, (char_u *)0L}
#endif
SCRIPTID_INIT},
- {"commentstring", "cms", P_STRING|P_ALLOCED|P_VI_DEF,
+ {"commentstring", "cms", P_STRING|P_ALLOCED|P_VI_DEF|P_CURSWANT,
#ifdef FEAT_FOLDING
(char_u *)&p_cms, PV_CMS,
{(char_u *)"/*%s*/", (char_u *)0L}
{"debug", NULL, P_STRING|P_VI_DEF,
(char_u *)&p_debug, PV_NONE,
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
- {"define", "def", P_STRING|P_ALLOCED|P_VI_DEF,
+ {"define", "def", P_STRING|P_ALLOCED|P_VI_DEF|P_CURSWANT,
#ifdef FEAT_FIND_ID
(char_u *)&p_def, PV_DEF,
{(char_u *)"^\\s*#\\s*define", (char_u *)0L}
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
- {"diffexpr", "dex", P_STRING|P_VI_DEF|P_SECURE,
+ {"diffexpr", "dex", P_STRING|P_VI_DEF|P_SECURE|P_CURSWANT,
#if defined(FEAT_DIFF) && defined(FEAT_EVAL)
(char_u *)&p_dex, PV_NONE,
{(char_u *)"", (char_u *)0L}
{(char_u *)0L, (char_u *)0L}
#endif
SCRIPTID_INIT},
- {"fileformat", "ff", P_STRING|P_ALLOCED|P_VI_DEF|P_RSTAT|P_NO_MKRC,
+ {"fileformat", "ff", P_STRING|P_ALLOCED|P_VI_DEF|P_RSTAT|P_NO_MKRC|P_CURSWANT,
(char_u *)&p_ff, PV_FF,
{(char_u *)DFLT_FF, (char_u *)0L} SCRIPTID_INIT},
{"fileformats", "ffs", P_STRING|P_VIM|P_COMMA|P_NODUP,
{"foldlevel", "fdl", P_NUM|P_VI_DEF|P_RWIN,
(char_u *)VAR_WIN, PV_FDL,
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
- {"foldlevelstart","fdls", P_NUM|P_VI_DEF,
+ {"foldlevelstart","fdls", P_NUM|P_VI_DEF|P_CURSWANT,
(char_u *)&p_fdls, PV_NONE,
{(char_u *)-1L, (char_u *)0L} SCRIPTID_INIT},
{"foldmarker", "fmr", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|
{"foldnestmax", "fdn", P_NUM|P_VI_DEF|P_RWIN,
(char_u *)VAR_WIN, PV_FDN,
{(char_u *)20L, (char_u *)0L} SCRIPTID_INIT},
- {"foldopen", "fdo", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+ {"foldopen", "fdo", P_STRING|P_VI_DEF|P_COMMA|P_NODUP|P_CURSWANT,
(char_u *)&p_fdo, PV_NONE,
{(char_u *)"block,hor,mark,percent,quickfix,search,tag,undo",
(char_u *)0L} SCRIPTID_INIT},
{"matchtime", "mat", P_NUM|P_VI_DEF,
(char_u *)&p_mat, PV_NONE,
{(char_u *)5L, (char_u *)0L} SCRIPTID_INIT},
- {"maxcombine", "mco", P_NUM|P_VI_DEF,
+ {"maxcombine", "mco", P_NUM|P_VI_DEF|P_CURSWANT,
#ifdef FEAT_MBYTE
(char_u *)&p_mco, PV_NONE,
#else
{(char_u *)0L, (char_u *)0L}
#endif
SCRIPTID_INIT},
- {"virtualedit", "ve", P_STRING|P_COMMA|P_NODUP|P_VI_DEF|P_VIM,
+ {"virtualedit", "ve", P_STRING|P_COMMA|P_NODUP|P_VI_DEF|P_VIM|P_CURSWANT,
#ifdef FEAT_VIRTUALEDIT
(char_u *)&p_ve, PV_NONE,
{(char_u *)"", (char_u *)""}
}
#endif
- if (curwin->w_curswant != MAXCOL)
- curwin->w_set_curswant = TRUE; /* in case 'showbreak' changed */
+ if (curwin->w_curswant != MAXCOL
+ && (options[opt_idx].flags & (P_CURSWANT | P_RCLR)) != 0)
+ curwin->w_set_curswant = TRUE;
+
#ifdef FEAT_GUI
/* check redraw when it's not a GUI option or the GUI is active. */
if (!redraw_gui_only || gui.in_use)
|| (int *)varp == &curwin->w_p_nu
|| (int *)varp == &curwin->w_p_rnu)
{
- if (curwin->w_curswant != MAXCOL)
- curwin->w_set_curswant = TRUE;
-
/* If 'number' is set, reset 'relativenumber'. */
/* If 'relativenumber' is set, reset 'number'. */
if ((int *)varp == &curwin->w_p_nu && curwin->w_p_nu)
{
if (curwin->w_p_wrap)
curwin->w_leftcol = 0;
- if (curwin->w_curswant != MAXCOL)
- curwin->w_set_curswant = TRUE;
}
#ifdef FEAT_WINDOWS
curbuf->b_p_imsearch = B_IMODE_USE_INSERT;
# endif
}
- if (curwin->w_curswant != MAXCOL)
- curwin->w_set_curswant = TRUE;
}
- else if ((int *)varp == &p_arshape)
- {
- if (curwin->w_curswant != MAXCOL)
- curwin->w_set_curswant = TRUE;
- }
-#endif
-
-#ifdef FEAT_LINEBREAK
- if ((int *)varp == &curwin->w_p_lbr)
- {
- if (curwin->w_curswant != MAXCOL)
- curwin->w_set_curswant = TRUE;
- }
-#endif
-
-#ifdef FEAT_RIGHTLEFT
- if ((int *)varp == &curwin->w_p_rl)
- {
- if (curwin->w_curswant != MAXCOL)
- curwin->w_set_curswant = TRUE;
- }
#endif
/*
options[opt_idx].flags |= P_WAS_SET;
comp_col(); /* in case 'ruler' or 'showcmd' changed */
-
+ if (curwin->w_curswant != MAXCOL
+ && (options[opt_idx].flags & (P_CURSWANT | P_RCLR)) != 0)
+ curwin->w_set_curswant = TRUE;
check_redraw(options[opt_idx].flags);
return NULL;
options[opt_idx].flags |= P_WAS_SET;
comp_col(); /* in case 'columns' or 'ls' changed */
- if (curwin->w_curswant != MAXCOL)
- curwin->w_set_curswant = TRUE; /* in case 'tabstop' changed */
+ if (curwin->w_curswant != MAXCOL
+ && (options[opt_idx].flags & (P_CURSWANT | P_RCLR)) != 0)
+ curwin->w_set_curswant = TRUE;
check_redraw(options[opt_idx].flags);
return errmsg;