1
mirror of https://github.com/neovim/neovim.git synced 2025-01-02 17:33:28 -07:00

Merge pull request from watiko/vim-7.4.830

vim-patch:7.4.{830,833}
This commit is contained in:
Justin M. Keyes 2016-02-17 04:26:29 -05:00
commit e4e5815242
2 changed files with 58 additions and 38 deletions

View File

@ -711,14 +711,10 @@ void set_init_1(void)
/* Must be before option_expand(), because that one needs vim_isIDc() */ /* Must be before option_expand(), because that one needs vim_isIDc() */
didset_options(); didset_options();
/* 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();
/*
* initialize the table for 'breakat'.
*/
fill_breakat_flags();
/* /*
* 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
@ -751,14 +747,8 @@ void set_init_1(void)
} }
} }
/* 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();
/* 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
* abilities (bidi namely). * abilities (bidi namely).
@ -768,11 +758,7 @@ void set_init_1(void)
if (os_env_exists("MLTERM")) if (os_env_exists("MLTERM"))
set_option_value((char_u *)"tbidi", 1L, NULL, 0); set_option_value((char_u *)"tbidi", 1L, NULL, 0);
/* Parse default for 'fillchars'. */ didset_options2();
(void)set_chars_option(&p_fcs);
/* Parse default for 'listchars'. */
(void)set_chars_option(&p_lcs);
// enc_locale() will try to find the encoding of the current locale. // enc_locale() will try to find the encoding of the current locale.
// This will be used when 'default' is used as encoding specifier // This will be used when 'default' is used as encoding specifier
@ -1151,9 +1137,12 @@ do_set (
*/ */
arg += 3; arg += 3;
if (*arg == '&') { if (*arg == '&') {
++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);
} else { } else {
showoptions(1, opt_flags); showoptions(1, opt_flags);
did_show = TRUE; did_show = TRUE;
@ -2073,9 +2062,31 @@ static void didset_options(void)
(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);
/* set cedit_key */ (void)did_set_spell_option(true);
// set cedit_key
(void)check_cedit(); (void)check_cedit();
briopt_check(curwin); briopt_check(curwin);
// initialize the table for 'breakat'.
fill_breakat_flags();
}
// More side effects of setting options.
static void didset_options2(void)
{
// Initialize the highlight_attr[] table.
(void)highlight_changed();
// Parse default for 'clipboard'.
opt_strings_flags(p_cb, p_cb_values, &cb_flags, true);
// Parse default for 'fillchars'.
(void)set_chars_option(&p_fcs);
// Parse default for 'listchars'.
(void)set_chars_option(&p_lcs);
// Parse default for 'wildmode'.
check_opt_wim();
} }
/* /*
@ -2854,22 +2865,7 @@ did_set_string_option (
|| varp == &(curwin->w_s->b_p_spf)) { || varp == &(curwin->w_s->b_p_spf)) {
// When 'spelllang' or 'spellfile' is set and there is a window for this // When 'spelllang' or 'spellfile' is set and there is a window for this
// buffer in which 'spell' is set load the wordlists. // buffer in which 'spell' is set load the wordlists.
if (varp == &(curwin->w_s->b_p_spf)) { errmsg = did_set_spell_option(varp == &(curwin->w_s->b_p_spf));
int 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_IN_TAB(wp, curtab) {
if (wp->w_buffer == curbuf && wp->w_p_spell) {
errmsg = did_set_spelllang(wp);
break;
}
}
}
} }
/* 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)) {
@ -3425,6 +3421,30 @@ char_u *check_stl_option(char_u *s)
return NULL; return NULL;
} }
static char_u *did_set_spell_option(bool is_spellfile)
{
char_u *errmsg = NULL;
if (is_spellfile) {
int 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_IN_TAB(wp, curtab) {
if (wp->w_buffer == curbuf && wp->w_p_spell) {
errmsg = did_set_spelllang(wp);
break;
}
}
}
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.

View File

@ -455,10 +455,10 @@ static int included_patches[] = {
836, 836,
835, 835,
834, 834,
// 833, 833,
// 832, // 832,
// 831, // 831,
// 830, 830,
// 829 NA // 829 NA
828, 828,
// 827 NA // 827 NA