http://bugzilla.lyx.org/show_bug.cgi?id=2218

I'm well aware that this patch is ugly (or better: makes an ugly 
implementation even uglier).

However, I do not have another solution to fix this really nasty bug, besides 
rewriting the whole spellchecker ui (which should be done eventually).

Opinions (or less ugly solutions)?

Jürgen
Index: src/frontends/qt4/QSpellchecker.cpp
===================================================================
--- src/frontends/qt4/QSpellchecker.cpp	(Revision 21446)
+++ src/frontends/qt4/QSpellchecker.cpp	(Arbeitskopie)
@@ -147,8 +147,17 @@
 
 void QSpellchecker::update_contents()
 {
-	if (isVisible() || controller().exitEarly())
+	// prevent double update (skipping of first word)
+	// see bug 2218
+	static bool first_checked = false;
+	if (controller().exitEarly()) {
 		controller().check();
+		first_checked = true;
+	}
+	else if (isVisible() && !first_checked)
+		controller().check();
+	else if (isVisible() && first_checked)
+		first_checked = false;
 }
 
 

Reply via email to