Skip to content

Commit 35a7a25

Browse files
committed
updated for version 7.4.524
Problem: When using ":ownsyntax" spell checking is messed up. (Issue 78) Solution: Use the window-local option values. (Christian Brabandt)
1 parent a0cfe22 commit 35a7a25

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/option.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6706,15 +6706,16 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
67066706
#ifdef FEAT_SPELL
67076707
/* When 'spelllang' or 'spellfile' is set and there is a window for this
67086708
* buffer in which 'spell' is set load the wordlists. */
6709-
else if (varp == &(curbuf->b_s.b_p_spl) || varp == &(curbuf->b_s.b_p_spf))
6709+
else if (varp == &(curwin->w_s->b_p_spl)
6710+
|| varp == &(curwin->w_s->b_p_spf))
67106711
{
67116712
win_T *wp;
67126713
int l;
67136714

6714-
if (varp == &(curbuf->b_s.b_p_spf))
6715+
if (varp == &(curwin->w_s->b_p_spf))
67156716
{
6716-
l = (int)STRLEN(curbuf->b_s.b_p_spf);
6717-
if (l > 0 && (l < 4 || STRCMP(curbuf->b_s.b_p_spf + l - 4,
6717+
l = (int)STRLEN(curwin->w_s->b_p_spf);
6718+
if (l > 0 && (l < 4 || STRCMP(curwin->w_s->b_p_spf + l - 4,
67186719
".add") != 0))
67196720
errmsg = e_invarg;
67206721
}

src/syntax.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6304,11 +6304,10 @@ ex_ownsyntax(eap)
63046304
curwin->w_s = (synblock_T *)alloc(sizeof(synblock_T));
63056305
memset(curwin->w_s, 0, sizeof(synblock_T));
63066306
#ifdef FEAT_SPELL
6307+
/* TODO: keep the spell checking as it was. */
63076308
curwin->w_p_spell = FALSE; /* No spell checking */
63086309
clear_string_option(&curwin->w_s->b_p_spc);
63096310
clear_string_option(&curwin->w_s->b_p_spf);
6310-
vim_regfree(curwin->w_s->b_cap_prog);
6311-
curwin->w_s->b_cap_prog = NULL;
63126311
clear_string_option(&curwin->w_s->b_p_spl);
63136312
#endif
63146313
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
524,
744746
/**/
745747
523,
746748
/**/

0 commit comments

Comments
 (0)