Hi Gary!

On So, 11 Aug 2013, Gary Johnson wrote:

> Christian,
> 
> On 2013-08-11, Christian Brabandt wrote:
> > On Sa, 10 Aug 2013, Gary Johnson wrote:
> 
> > > Now that 7.4 has been released and we can resume considering
> > > features instead of just bug fixes, can we have this patch included?
> > > If it isn't high on Bram's list, then Christian, would you please
> > > post a patch that works with 7.4?  I tried applying this patch to
> > > 7.4 and all I got was "2 out of 2 hunks FAILED".  I didn't look into
> > > why it failed.
> > 
> > I applies to me with a certain offset for me. But anyway here is an
> > improved version, that also does, what the todo entry suggesgs:
> > 
> > ,----
> > | Patch to make "z=" work when 'spell' is off.  Does this have nasty side
> > | effects?  (Christian Brabandt, 2012 Aug 5)
> > | Would also need to do this for spellbadword() and spellsuggest().
> > `----
> 
> Thank you, but I did not receive a new patch.  Was one supposed to
> be attached to your message?

Argl, I feel so old. And I even wrote a Vim plugin¹, that is supposed to 
prevent making me look silly, but I didn't even mention the word 
"attach" in my message. 

Oh well, here is an updated version attached. Yes, it is really 
attached...


hopefully ;)

¹) http://www.vim.org/scripts/script.php?script_id=2796

Mit freundlichen Grüßen
Christian
-- 
Es wäre gut, Bücher zu kaufen, wenn man die Zeit, sie zu lesen,
mitkaufen könnte.
                -- Arthur Schopenhauer

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


diff --git a/src/eval.c b/src/eval.c
--- a/src/eval.c
+++ b/src/eval.c
@@ -17151,9 +17151,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)
-	return;
+    {
+#ifdef FEAT_SPELL
+	curwin->w_p_spell = wo_spell_save;
+#endif
+	return;
+    }
 
 #ifdef FEAT_SPELL
     if (argvars[0].v_type == VAR_UNKNOWN)
@@ -17163,7 +17184,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;
@@ -17183,6 +17204,7 @@
 	    }
 	}
     }
+    curwin->w_p_spell = wo_spell_save;
 #endif
 
     list_append_string(rettv->vval.v_list, word, len);
@@ -17210,13 +17232,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)
-	return;
-
+    {
 #ifdef FEAT_SPELL
-    if (curwin->w_p_spell && *curwin->w_s->b_p_spl != NUL)
+	curwin->w_p_spell = wo_spell_save;
+#endif
+	return;
+    }
+
+#ifdef FEAT_SPELL
+    if (*curwin->w_s->b_p_spl != NUL)
     {
 	str = get_tv_string(&argvars[0]);
 	if (argvars[1].v_type != VAR_UNKNOWN)
@@ -17253,6 +17294,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
@@ -10158,9 +10158,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;
+    }
+
 
 #ifdef FEAT_VISUAL
     if (VIsual_active)
@@ -10380,6 +10391,7 @@
     spell_find_cleanup(&sug);
 skip:
     vim_free(line);
+    curwin->w_p_spell = wo_spell_save;
 }
 
 /*

Raspunde prin e-mail lui