aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bürgin <676c7473@gmail.com>2015-05-01 21:18:46 +0200
committerJustin M. Keyes <justinkz@gmail.com>2015-05-09 10:23:23 -0400
commit96997fffbde4ca5e09c4ad5a1f7010152e4239ef (patch)
tree9c95d26bd98bea319905b897654013f0a1573ca0
parentd3a57b9b0b16edb183fb57eeb0831ee42b204929 (diff)
downloadrneovim-96997fffbde4ca5e09c4ad5a1f7010152e4239ef.tar.gz
rneovim-96997fffbde4ca5e09c4ad5a1f7010152e4239ef.tar.bz2
rneovim-96997fffbde4ca5e09c4ad5a1f7010152e4239ef.zip
vim-patch:7.4.524 #2559
Problem: When using ":ownsyntax" spell checking is messed up. (Issue 78) Solution: Use the window-local option values. (Christian Brabandt) https://github.com/vim/vim/commit/v7-4-524 See also https://code.google.com/p/vim/issues/detail?id=78
-rw-r--r--src/nvim/option.c19
-rw-r--r--src/nvim/syntax.c3
-rw-r--r--src/nvim/version.c2
3 files changed, 11 insertions, 13 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index dcf02513dd..8aeeb7fe8b 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -4013,17 +4013,16 @@ did_set_string_option (
else if (varp == &p_cb) {
if (opt_strings_flags(p_cb, p_cb_values, &cb_flags, TRUE) != OK)
errmsg = e_invarg;
- }
- /* When 'spelllang' or 'spellfile' is set and there is a window for this
- * buffer in which 'spell' is set load the wordlists. */
- else if (varp == &(curbuf->b_s.b_p_spl) || varp == &(curbuf->b_s.b_p_spf)) {
- int l;
-
- if (varp == &(curbuf->b_s.b_p_spf)) {
- l = (int)STRLEN(curbuf->b_s.b_p_spf);
- if (l > 0 && (l < 4 || STRCMP(curbuf->b_s.b_p_spf + l - 4,
- ".add") != 0))
+ } else if (varp == &(curwin->w_s->b_p_spl)
+ || 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) {
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index ec54887246..0bee42c4a9 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -5404,11 +5404,10 @@ void ex_ownsyntax(exarg_T *eap)
if (curwin->w_s == &curwin->w_buffer->b_s) {
curwin->w_s = xmalloc(sizeof(synblock_T));
memset(curwin->w_s, 0, sizeof(synblock_T));
+ // TODO: Keep the spell checking as it was.
curwin->w_p_spell = FALSE; /* No spell checking */
clear_string_option(&curwin->w_s->b_p_spc);
clear_string_option(&curwin->w_s->b_p_spf);
- vim_regfree(curwin->w_s->b_cap_prog);
- curwin->w_s->b_cap_prog = NULL;
clear_string_option(&curwin->w_s->b_p_spl);
}
diff --git a/src/nvim/version.c b/src/nvim/version.c
index e80b653c00..e0cbba4cbc 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -259,7 +259,7 @@ static int included_patches[] = {
527,
526,
525,
- //524,
+ 524,
//523 NA
//522 NA
521,