Some patch after 7.4.1949 broke Christian Brabandt's
enable_spellchecking patch, posted to this list on 12 August 2013,
which enables z= to work even with 'spell' off. I think it was
7.4.2063, which split off part of eval.c into evalfunc.c.
I fixed the original patch and created a new one, attached. It
applies to at least 7.4.2080 and 7.4.2085.
It would be nice if this could be incorporated into the official
Vim.
Regards,
Gary
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/evalfunc.c b/src/evalfunc.c
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -10367,9 +10367,30 @@
char_u *word = (char_u *)"";
hlf_T attr = HLF_COUNT;
int len = 0;
+#ifdef FEAT_SPELL
+ int wo_spell_save = curwin->w_p_spell;
+
+ if (!curwin->w_p_spell)
+ {
+ did_set_spelllang(curwin);
+ curwin->w_p_spell = TRUE;
+ }
+
+ if (*curwin->w_s->b_p_spl == NUL)
+ {
+ EMSG(_("E756: Spell checking is not possible"));
+ curwin->w_p_spell = wo_spell_save;
+ return;
+ }
+#endif
if (rettv_list_alloc(rettv) == FAIL)
+ {
+#ifdef FEAT_SPELL
+ curwin->w_p_spell = wo_spell_save;
+#endif
return;
+ }
#ifdef FEAT_SPELL
if (argvars[0].v_type == VAR_UNKNOWN)
@@ -10379,7 +10400,7 @@
if (len != 0)
word = ml_get_cursor();
}
- else if (curwin->w_p_spell && *curbuf->b_s.b_p_spl != NUL)
+ else if (*curbuf->b_s.b_p_spl != NUL)
{
char_u *str = get_tv_string_chk(&argvars[0]);
int capcol = -1;
@@ -10399,6 +10420,7 @@
}
}
}
+ curwin->w_p_spell = wo_spell_save;
#endif
list_append_string(rettv->vval.v_list, word, len);
@@ -10424,13 +10446,32 @@
int i;
listitem_T *li;
int need_capital = FALSE;
+ int wo_spell_save = curwin->w_p_spell;
+
+ if (!curwin->w_p_spell)
+ {
+ did_set_spelllang(curwin);
+ curwin->w_p_spell = TRUE;
+ }
+
+ if (*curwin->w_s->b_p_spl == NUL)
+ {
+ EMSG(_("E756: Spell checking is not possible"));
+ curwin->w_p_spell = wo_spell_save;
+ return;
+ }
#endif
if (rettv_list_alloc(rettv) == FAIL)
+ {
+#ifdef FEAT_SPELL
+ curwin->w_p_spell = wo_spell_save;
+#endif
return;
+ }
#ifdef FEAT_SPELL
- if (curwin->w_p_spell && *curwin->w_s->b_p_spl != NUL)
+ if (*curwin->w_s->b_p_spl != NUL)
{
str = get_tv_string(&argvars[0]);
if (argvars[1].v_type != VAR_UNKNOWN)
@@ -10467,6 +10508,7 @@
}
ga_clear(&ga);
}
+ curwin->w_p_spell = wo_spell_save;
#endif
}
diff --git a/src/spell.c b/src/spell.c
--- a/src/spell.c
+++ b/src/spell.c
@@ -3353,9 +3353,20 @@
int selected = count;
int badlen = 0;
int msg_scroll_save = msg_scroll;
-
- if (no_spell_checking(curwin))
+ int wo_spell_save = curwin->w_p_spell;
+
+ if (!curwin->w_p_spell)
+ {
+ did_set_spelllang(curwin);
+ curwin->w_p_spell = TRUE;
+ }
+
+ if (*curwin->w_s->b_p_spl == NUL)
+ {
+ EMSG(_("E756: Spell checking is not possible"));
return;
+ }
+
if (VIsual_active)
{
@@ -3572,6 +3583,7 @@
spell_find_cleanup(&sug);
skip:
vim_free(line);
+ curwin->w_p_spell = wo_spell_save;
}
/*