From b6fdc3eb47c2d25c194505f1dff1f98fa4302f1e Mon Sep 17 00:00:00 2001 From: watiko Date: Thu, 11 Feb 2016 21:59:08 +0900 Subject: vim-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. https://github.com/vim/vim/commit/b341dda575899458f7075614dcedf0a80ee9d080 --- ":set all&" does not reset 'encoding' in neovim. --- src/nvim/option.c | 5 +++-- src/nvim/version.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nvim/option.c b/src/nvim/option.c index c11e22703e..616eba31f6 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1150,9 +1150,10 @@ do_set ( */ arg += 3; if (*arg == '&') { - ++arg; - /* Only for :set command set global value of local options. */ + arg++; + // Only for :set command set global value of local options. set_options_default(OPT_FREE | opt_flags); + redraw_all_later(CLEAR); } else { showoptions(1, opt_flags); did_show = TRUE; diff --git a/src/nvim/version.c b/src/nvim/version.c index 4b00349270..de045e8dae 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -458,7 +458,7 @@ static int included_patches[] = { // 833, // 832, // 831, - // 830, + 830, // 829 NA 828, // 827, -- cgit From 6c99667b6ee8299d6b8f71c42837dc325fc3ae8e Mon Sep 17 00:00:00 2001 From: watiko Date: Fri, 12 Feb 2016 14:57:28 +0900 Subject: vim-patch:7.4.833 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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... https://github.com/vim/vim/commit/e68c25c677167bb90ac5ec77038e340c730b6567 --- src/nvim/option.c | 87 +++++++++++++++++++++++++++++++++--------------------- src/nvim/version.c | 2 +- 2 files changed, 54 insertions(+), 35 deletions(-) diff --git a/src/nvim/option.c b/src/nvim/option.c index 616eba31f6..fa25d02b91 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -710,14 +710,10 @@ void set_init_1(void) /* Must be before option_expand(), because that one needs vim_isIDc() */ 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(); - /* - * initialize the table for 'breakat'. - */ - fill_breakat_flags(); - /* * Expand environment variables and things like "~" for the defaults. * If option_expand() returns non-NULL the variable is expanded. This can @@ -750,14 +746,8 @@ void set_init_1(void) } } - /* Initialize the highlight_attr[] table. */ - highlight_changed(); - save_file_ff(curbuf); /* Buffer is unchanged */ - /* Parse default for 'wildmode' */ - check_opt_wim(); - /* Detect use of mlterm. * Mlterm is a terminal emulator akin to xterm that has some special * abilities (bidi namely). @@ -767,11 +757,7 @@ void set_init_1(void) if (os_env_exists("MLTERM")) set_option_value((char_u *)"tbidi", 1L, NULL, 0); - /* Parse default for 'fillchars'. */ - (void)set_chars_option(&p_fcs); - - /* Parse default for 'listchars'. */ - (void)set_chars_option(&p_lcs); + didset_options2(); // enc_locale() will try to find the encoding of the current locale. // This will be used when 'default' is used as encoding specifier @@ -1153,6 +1139,8 @@ do_set ( arg++; // Only for :set command set global value of local options. set_options_default(OPT_FREE | opt_flags); + didset_options(); + didset_options2(); redraw_all_later(CLEAR); } else { showoptions(1, opt_flags); @@ -2073,9 +2061,31 @@ static void didset_options(void) (void)spell_check_msm(); (void)spell_check_sps(); (void)compile_cap_prog(curwin->w_s); - /* set cedit_key */ + (void)did_set_spell_option(true); + // set cedit_key (void)check_cedit(); 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 +2864,7 @@ did_set_string_option ( || varp == &(curwin->w_s->b_p_spf)) { // When 'spelllang' or 'spellfile' is set and there is a window for this // buffer in which 'spell' is set load the wordlists. - if (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; - } - } - } + errmsg = did_set_spell_option(varp == &(curwin->w_s->b_p_spf)); } /* When 'spellcapcheck' is set compile the regexp program. */ else if (varp == &(curwin->w_s->b_p_spc)) { @@ -3425,6 +3420,30 @@ char_u *check_stl_option(char_u *s) 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'. * Return error message when failed, NULL when OK. diff --git a/src/nvim/version.c b/src/nvim/version.c index de045e8dae..bd6632e38a 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -455,7 +455,7 @@ static int included_patches[] = { 836, // 835, 834, - // 833, + 833, // 832, // 831, 830, -- cgit