mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 7.4.833
Problem: More side effects of ":set all&" are missing. (Björn Linse) Solution: Call didset_options() and add didset_options2() to collect more side effects to take care of. Still not everything...
This commit is contained in:
parent
be83b73ddb
commit
e68c25c677
120
src/option.c
120
src/option.c
@ -3079,6 +3079,7 @@ static void did_set_title __ARGS((int icon));
|
|||||||
#endif
|
#endif
|
||||||
static char_u *option_expand __ARGS((int opt_idx, char_u *val));
|
static char_u *option_expand __ARGS((int opt_idx, char_u *val));
|
||||||
static void didset_options __ARGS((void));
|
static void didset_options __ARGS((void));
|
||||||
|
static void didset_options2 __ARGS((void));
|
||||||
static void check_string_option __ARGS((char_u **pp));
|
static void check_string_option __ARGS((char_u **pp));
|
||||||
#if defined(FEAT_EVAL) || defined(PROTO)
|
#if defined(FEAT_EVAL) || defined(PROTO)
|
||||||
static long_u *insecure_flag __ARGS((int opt_idx, int opt_flags));
|
static long_u *insecure_flag __ARGS((int opt_idx, int opt_flags));
|
||||||
@ -3096,6 +3097,7 @@ static int int_cmp __ARGS((const void *a, const void *b));
|
|||||||
static char_u *check_clipboard_option __ARGS((void));
|
static char_u *check_clipboard_option __ARGS((void));
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_SPELL
|
#ifdef FEAT_SPELL
|
||||||
|
static char_u *did_set_spell_option __ARGS((int is_spellfile));
|
||||||
static char_u *compile_cap_prog __ARGS((synblock_T *synblock));
|
static char_u *compile_cap_prog __ARGS((synblock_T *synblock));
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_EVAL
|
#ifdef FEAT_EVAL
|
||||||
@ -3376,17 +3378,11 @@ set_init_1()
|
|||||||
didset_options();
|
didset_options();
|
||||||
|
|
||||||
#ifdef FEAT_SPELL
|
#ifdef FEAT_SPELL
|
||||||
/* Use the current chartab for the generic chartab. */
|
/* Use the current chartab for the generic chartab. This is not in
|
||||||
|
* didset_options() because it only depends on 'encoding'. */
|
||||||
init_spell_chartab();
|
init_spell_chartab();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_LINEBREAK
|
|
||||||
/*
|
|
||||||
* initialize the table for 'breakat'.
|
|
||||||
*/
|
|
||||||
fill_breakat_flags();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Expand environment variables and things like "~" for the defaults.
|
* Expand environment variables and things like "~" for the defaults.
|
||||||
* If option_expand() returns non-NULL the variable is expanded. This can
|
* If option_expand() returns non-NULL the variable is expanded. This can
|
||||||
@ -3418,14 +3414,8 @@ set_init_1()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the highlight_attr[] table. */
|
|
||||||
highlight_changed();
|
|
||||||
|
|
||||||
save_file_ff(curbuf); /* Buffer is unchanged */
|
save_file_ff(curbuf); /* Buffer is unchanged */
|
||||||
|
|
||||||
/* Parse default for 'wildmode' */
|
|
||||||
check_opt_wim();
|
|
||||||
|
|
||||||
#if defined(FEAT_ARABIC)
|
#if defined(FEAT_ARABIC)
|
||||||
/* Detect use of mlterm.
|
/* Detect use of mlterm.
|
||||||
* Mlterm is a terminal emulator akin to xterm that has some special
|
* Mlterm is a terminal emulator akin to xterm that has some special
|
||||||
@ -3437,15 +3427,7 @@ set_init_1()
|
|||||||
set_option_value((char_u *)"tbidi", 1L, NULL, 0);
|
set_option_value((char_u *)"tbidi", 1L, NULL, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
|
didset_options2();
|
||||||
/* Parse default for 'fillchars'. */
|
|
||||||
(void)set_chars_option(&p_fcs);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FEAT_CLIPBOARD
|
|
||||||
/* Parse default for 'clipboard' */
|
|
||||||
(void)check_clipboard_option();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FEAT_MBYTE
|
#ifdef FEAT_MBYTE
|
||||||
# if defined(WIN3264) && defined(FEAT_GETTEXT)
|
# if defined(WIN3264) && defined(FEAT_GETTEXT)
|
||||||
@ -3670,7 +3652,10 @@ set_options_default(opt_flags)
|
|||||||
|
|
||||||
for (i = 0; !istermoption(&options[i]); i++)
|
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))
|
&& (opt_flags == 0
|
||||||
|
|| (options[i].var != (char_u *)&p_enc
|
||||||
|
&& options[i].var != (char_u *)&p_cm
|
||||||
|
&& options[i].var != (char_u *)&p_key)))
|
||||||
set_option_default(i, opt_flags, p_cp);
|
set_option_default(i, opt_flags, p_cp);
|
||||||
|
|
||||||
#ifdef FEAT_WINDOWS
|
#ifdef FEAT_WINDOWS
|
||||||
@ -4206,6 +4191,8 @@ do_set(arg, opt_flags)
|
|||||||
++arg;
|
++arg;
|
||||||
/* Only for :set command set global value of local options. */
|
/* Only for :set command set global value of local options. */
|
||||||
set_options_default(OPT_FREE | opt_flags);
|
set_options_default(OPT_FREE | opt_flags);
|
||||||
|
didset_options();
|
||||||
|
didset_options2();
|
||||||
redraw_all_later(CLEAR);
|
redraw_all_later(CLEAR);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -5348,6 +5335,7 @@ didset_options()
|
|||||||
(void)spell_check_msm();
|
(void)spell_check_msm();
|
||||||
(void)spell_check_sps();
|
(void)spell_check_sps();
|
||||||
(void)compile_cap_prog(curwin->w_s);
|
(void)compile_cap_prog(curwin->w_s);
|
||||||
|
(void)did_set_spell_option(TRUE);
|
||||||
#endif
|
#endif
|
||||||
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
|
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
|
||||||
(void)opt_strings_flags(p_toolbar, p_toolbar_values, &toolbar_flags, TRUE);
|
(void)opt_strings_flags(p_toolbar, p_toolbar_values, &toolbar_flags, TRUE);
|
||||||
@ -5362,6 +5350,35 @@ didset_options()
|
|||||||
#ifdef FEAT_LINEBREAK
|
#ifdef FEAT_LINEBREAK
|
||||||
briopt_check(curwin);
|
briopt_check(curwin);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef FEAT_LINEBREAK
|
||||||
|
/* initialize the table for 'breakat'. */
|
||||||
|
fill_breakat_flags();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* More side effects of setting options.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
didset_options2()
|
||||||
|
{
|
||||||
|
/* Initialize the highlight_attr[] table. */
|
||||||
|
(void)highlight_changed();
|
||||||
|
|
||||||
|
/* Parse default for 'wildmode' */
|
||||||
|
check_opt_wim();
|
||||||
|
|
||||||
|
(void)set_chars_option(&p_lcs);
|
||||||
|
#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
|
||||||
|
/* Parse default for 'fillchars'. */
|
||||||
|
(void)set_chars_option(&p_fcs);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef FEAT_CLIPBOARD
|
||||||
|
/* Parse default for 'clipboard' */
|
||||||
|
(void)check_clipboard_option();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -6794,28 +6811,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
|
|||||||
else if (varp == &(curwin->w_s->b_p_spl)
|
else if (varp == &(curwin->w_s->b_p_spl)
|
||||||
|| varp == &(curwin->w_s->b_p_spf))
|
|| varp == &(curwin->w_s->b_p_spf))
|
||||||
{
|
{
|
||||||
win_T *wp;
|
errmsg = did_set_spell_option(varp == &(curwin->w_s->b_p_spf));
|
||||||
int l;
|
|
||||||
|
|
||||||
if (varp == &(curwin->w_s->b_p_spf))
|
|
||||||
{
|
|
||||||
l = (int)STRLEN(curwin->w_s->b_p_spf);
|
|
||||||
if (l > 0 && (l < 4 || STRCMP(curwin->w_s->b_p_spf + l - 4,
|
|
||||||
".add") != 0))
|
|
||||||
errmsg = e_invarg;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (errmsg == NULL)
|
|
||||||
{
|
|
||||||
FOR_ALL_WINDOWS(wp)
|
|
||||||
if (wp->w_buffer == curbuf && wp->w_p_spell)
|
|
||||||
{
|
|
||||||
errmsg = did_set_spelllang(wp);
|
|
||||||
# ifdef FEAT_WINDOWS
|
|
||||||
break;
|
|
||||||
# endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* When 'spellcapcheck' is set compile the regexp program. */
|
/* When 'spellcapcheck' is set compile the regexp program. */
|
||||||
else if (varp == &(curwin->w_s->b_p_spc))
|
else if (varp == &(curwin->w_s->b_p_spc))
|
||||||
@ -7687,6 +7683,36 @@ check_clipboard_option()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_SPELL
|
#ifdef FEAT_SPELL
|
||||||
|
static char_u *
|
||||||
|
did_set_spell_option(is_spellfile)
|
||||||
|
int is_spellfile;
|
||||||
|
{
|
||||||
|
char_u *errmsg = NULL;
|
||||||
|
win_T *wp;
|
||||||
|
int l;
|
||||||
|
|
||||||
|
if (is_spellfile)
|
||||||
|
{
|
||||||
|
l = (int)STRLEN(curwin->w_s->b_p_spf);
|
||||||
|
if (l > 0 && (l < 4
|
||||||
|
|| STRCMP(curwin->w_s->b_p_spf + l - 4, ".add") != 0))
|
||||||
|
errmsg = e_invarg;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errmsg == NULL)
|
||||||
|
{
|
||||||
|
FOR_ALL_WINDOWS(wp)
|
||||||
|
if (wp->w_buffer == curbuf && wp->w_p_spell)
|
||||||
|
{
|
||||||
|
errmsg = did_set_spelllang(wp);
|
||||||
|
# ifdef FEAT_WINDOWS
|
||||||
|
break;
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return errmsg;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set curbuf->b_cap_prog to the regexp program for 'spellcapcheck'.
|
* Set curbuf->b_cap_prog to the regexp program for 'spellcapcheck'.
|
||||||
* Return error message when failed, NULL when OK.
|
* Return error message when failed, NULL when OK.
|
||||||
@ -11741,6 +11767,7 @@ vimrc_found(fname, envname)
|
|||||||
if (!(options[opt_idx].flags & (P_WAS_SET|P_VI_DEF)))
|
if (!(options[opt_idx].flags & (P_WAS_SET|P_VI_DEF)))
|
||||||
set_option_default(opt_idx, OPT_FREE, FALSE);
|
set_option_default(opt_idx, OPT_FREE, FALSE);
|
||||||
didset_options();
|
didset_options();
|
||||||
|
didset_options2();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fname != NULL)
|
if (fname != NULL)
|
||||||
@ -11829,6 +11856,7 @@ compatible_set()
|
|||||||
|| (!(options[opt_idx].flags & P_VI_DEF) && !p_cp))
|
|| (!(options[opt_idx].flags & P_VI_DEF) && !p_cp))
|
||||||
set_option_default(opt_idx, OPT_FREE, p_cp);
|
set_option_default(opt_idx, OPT_FREE, p_cp);
|
||||||
didset_options();
|
didset_options();
|
||||||
|
didset_options2();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_LINEBREAK
|
#ifdef FEAT_LINEBREAK
|
||||||
|
@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
833,
|
||||||
/**/
|
/**/
|
||||||
832,
|
832,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user