>>>>> "Alfredo" == Alfredo Braunstein <[EMAIL PROTECTED]> writes:

>> The problem is that this code does not use the dispatch mechanism,
>> but direct calls to the kernel.

Alfredo> Aha! That's the problem ;-) Well then just calling update (I
Alfredo> think that fullRebreak + update in head) directly should be
Alfredo> enough.

Like that?

There is also a CoordBranch version, since they are a bit different.
Shall I apply it, or do you prefer to merge by your self from time to
time?

JMarc

Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2041
diff -u -p -r1.2041 ChangeLog
--- src/ChangeLog	19 Nov 2004 16:17:51 -0000	1.2041
+++ src/ChangeLog	22 Nov 2004 14:13:55 -0000
@@ -1,3 +1,8 @@
+2004-11-22  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* lyxfind.C (findNextChange): update the bufferview after setting
+	the selection
+
 2004-11-16  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* text3.C (getStatus): disable LFUN_INSET_OPTARG when the max
Index: src/lyxfind.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfind.C,v
retrieving revision 1.87
diff -u -p -r1.87 lyxfind.C
--- src/lyxfind.C	18 Nov 2004 14:58:50 -0000	1.87
+++ src/lyxfind.C	22 Nov 2004 14:13:56 -0000
@@ -363,6 +363,11 @@ bool findNextChange(BufferView * bv)
 	}
 	pos_type length = end - pos;
 	bv->putSelectionAt(cur, length, false);
+	// if we used a lfun like in find/replace, dispatch would do
+	// that for us
+	bv->update();
+	if (bv->fitCursor())
+		bv->update();
 
 	return true;
 }
Index: src/frontends/controllers/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ChangeLog,v
retrieving revision 1.457
diff -u -p -r1.457 ChangeLog
--- src/frontends/controllers/ChangeLog	18 Nov 2004 14:58:54 -0000	1.457
+++ src/frontends/controllers/ChangeLog	22 Nov 2004 14:13:57 -0000
@@ -1,3 +1,8 @@
+2004-11-22  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* ControlSpellchecker.C (check): update the view when setting the
+	selection; use word_ instead of getWord.
+
 2004-11-18  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* ControlSpellchecker.C (nextWord): rewrite to skip words
Index: src/frontends/controllers/ControlSpellchecker.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlSpellchecker.C,v
retrieving revision 1.73
diff -u -p -r1.73 ControlSpellchecker.C
--- src/frontends/controllers/ControlSpellchecker.C	18 Nov 2004 14:58:54 -0000	1.73
+++ src/frontends/controllers/ControlSpellchecker.C	22 Nov 2004 14:14:02 -0000
@@ -199,8 +199,10 @@ void ControlSpellchecker::check()
 		word_ = nextWord(cur, start, bufferparams);
 
 		// end of document
-		if (getWord().empty())
-			break;
+		if (word_.empty()) {
+			showSummary();
+			return;
+		}
 
 		++count_;
 
@@ -225,16 +227,17 @@ void ControlSpellchecker::check()
 			return;
 	}
 
-	lyxerr[Debug::GUI] << "Found word \"" << getWord() << "\"" << endl;
+	lyxerr[Debug::GUI] << "Found word \"" << word_ << "\"" << endl;
 
-	if (getWord().empty()) {
-		showSummary();
-		return;
-	}
-
-	int const size = getWord().size();
+	int const size = word_.size();
 	cur.pos() -= size;
 	kernel().bufferview()->putSelectionAt(cur, size, false);
+	// if we used a lfun like in find/replace, dispatch would do
+	// that for us
+	kernel().bufferview()->update();
+	if (kernel().bufferview()->fitCursor())
+		kernel().bufferview()->update();
+
 
 	// set suggestions
 	if (res != SpellBase::OK && res != SpellBase::IGNORE) {
Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2022.2.6
diff -u -p -r1.2022.2.6 ChangeLog
--- src/ChangeLog	20 Nov 2004 14:37:39 -0000	1.2022.2.6
+++ src/ChangeLog	22 Nov 2004 14:15:57 -0000
@@ -1,3 +1,8 @@
+2004-11-22  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* lyxfind.C (findNextChange): update the bufferview after setting
+	the selection
+
 2004-11-16  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* text3.C (getStatus): disable LFUN_INSET_OPTARG when the max
Index: src/lyxfind.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfind.C,v
retrieving revision 1.86.2.2
diff -u -p -r1.86.2.2 lyxfind.C
--- src/lyxfind.C	20 Nov 2004 14:37:40 -0000	1.86.2.2
+++ src/lyxfind.C	22 Nov 2004 14:15:59 -0000
@@ -363,6 +363,9 @@ bool findNextChange(BufferView * bv)
 	}
 	pos_type length = end - pos;
 	bv->putSelectionAt(cur, length, false);
+	// if we used a lfun like in find/replace, dispatch would do
+	// that for us
+	bv->update();
 
 	return true;
 }
Index: src/frontends/controllers/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ChangeLog,v
retrieving revision 1.453.2.3
diff -u -p -r1.453.2.3 ChangeLog
--- src/frontends/controllers/ChangeLog	20 Nov 2004 14:37:45 -0000	1.453.2.3
+++ src/frontends/controllers/ChangeLog	22 Nov 2004 14:16:14 -0000
@@ -1,3 +1,8 @@
+2004-11-22  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* ControlSpellchecker.C (check): update the view when setting the
+	selection; use word_ instead of getWord.
+
 2004-11-18  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* ControlSpellchecker.C (nextWord): rewrite to skip words
Index: src/frontends/controllers/ControlSpellchecker.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlSpellchecker.C,v
retrieving revision 1.72.2.1
diff -u -p -r1.72.2.1 ControlSpellchecker.C
--- src/frontends/controllers/ControlSpellchecker.C	20 Nov 2004 14:37:45 -0000	1.72.2.1
+++ src/frontends/controllers/ControlSpellchecker.C	22 Nov 2004 14:16:14 -0000
@@ -199,8 +199,10 @@ void ControlSpellchecker::check()
 		word_ = nextWord(cur, start, bufferparams);
 
 		// end of document
-		if (getWord().empty())
-			break;
+		if (word_.empty()) {
+			showSummary();
+			return;
+		}
 
 		++count_;
 
@@ -225,16 +227,14 @@ void ControlSpellchecker::check()
 			return;
 	}
 
-	lyxerr[Debug::GUI] << "Found word \"" << getWord() << "\"" << endl;
-
-	if (getWord().empty()) {
-		showSummary();
-		return;
-	}
+	lyxerr[Debug::GUI] << "Found word \"" << word_ << "\"" << endl;
 
-	int const size = getWord().size();
+	int const size = word_.size();
 	cur.pos() -= size;
 	kernel().bufferview()->putSelectionAt(cur, size, false);
+	// if we used a lfun like in find/replace, dispatch would do
+	// that for us
+	kernel().bufferview()->update();
 
 	// set suggestions
 	if (res != SpellBase::OK && res != SpellBase::IGNORE) {

Reply via email to