On Thu, Jan 19, 2006 at 04:17:15PM +0100, Jean-Marc Lasgouttes wrote:
> >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
> 
> Martin> On Thu, 2006-01-19 at 14:53 +0100, Jean-Marc Lasgouttes wrote:
> >> The following patch gets rid of some debug output. It also improves
> >> some Counters error messages to be more useful (I saw these with
> >> beamer.layout).
> >> 
> >> Lars, OK?
> 
> Martin> Didn't you find goUpDown (moving up and down through math
> Martin> insets) horribly slow?
> 
> Yes, it is slow. You are referring to your bruteFind patch, right?
> 
> What is the status of this? There is a patch that uses forwardPar, and
> another one that avoids calling bruteFind in some cases, right?

Yes. The one modifying bruteFind was rejected by Lars, on the ground
(sound IMO) that he wants to keep that as a super-general find routine
for when everything else fails. The other one would "fix" this bug by
just moving to in front/behind the math inset. Ugly, but it remembers
the x location when you press further cursor ups/downs. 

I would think that is good enough for 1.4.0, with a FIXME stating that
some bruteFind-n method should be built to do a proper job of this
(e.g., searching the previous, current and next outer paragraphs).

Attached.

- Martin

Index: cursor.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.C,v
retrieving revision 1.141
diff -u -p -r1.141 cursor.C
--- cursor.C    11 Jan 2006 17:08:50 -0000      1.141
+++ cursor.C    19 Jan 2006 18:00:51 -0000
@@ -1029,12 +1040,10 @@ bool LCursor::goUpDown(bool up)
                        return true;
                }
 
-               // no such inset found, just take something "above"
-               if (!popLeft()) {
-                       lyxerr << "updown: popleft failed (strange case)" << 
endl;
-                       int ylow  = up ? 0 : yo + 1;
-                       int yhigh = up ? yo - 1 : bv().workHeight();
-                       return bruteFind(*this, xo, yo, 0, bv().workWidth(), 
ylow, yhigh);
+               // no such inset found, just get out somehow
+               if (!( up ? popLeft() : popRight() )) {
+                       lyxerr << "updown: popleft/right failed (strange case)" 
<< endl;
+                       return true;
                }
 
                // any improvement so far?

Attachment: pgp3LzNSOhrVj.pgp
Description: PGP signature

Reply via email to