On Thu, Dec 07, 2006 at 09:47:56AM +0100, Abdelrazak Younes wrote:
> Enrico Forestieri wrote:
...
> >BTW, I noticed that LyX crashes if you press page down right after
> >loading this document:
> >http://bugzilla.lyx.org/attachment.cgi?id=1296&action=view
> 
> I cannot access this link and 1296 doesn't seem to be related. But, FYI 
> I solved the same crash in 1.5. I thought it was 1.5 specific but 
> perhaps not, here it the patch (more comments about your patch below):

Thanks Abdel, that fixed it. Also thanks for having solved bug 2900 ;-)

Jean-Marc, may I apply the attached patch? It is unrelated to bug 2900.

-- 
Enrico
Index: src/text3.C
===================================================================
--- src/text3.C (revision 16192)
+++ src/text3.C (working copy)
@@ -203,12 +203,19 @@ bool LyXText::cursorPrevious(LCursor & c
        bool updated = setCursorFromCoordinates(cur, x, 0);
        if (updated)
                cur.bv().update();
-       updated |= cursorUp(cur);
+
+       if (cur.inMathed())
+               updated |= cur.up();
+       else
+               updated |= cursorUp(cur);
 
        if (cpar == cur.pit() && cpos == cur.pos()) {
                // we have a row which is taller than the workarea. The
                // simplest solution is to move to the previous row instead.
-               updated |= cursorUp(cur);
+               if (cur.inMathed())
+                       updated |= cur.up();
+               else
+                       updated |= cursorUp(cur);
        }
 
        cur.bv().updateScrollbar();
@@ -226,12 +233,19 @@ bool LyXText::cursorNext(LCursor & cur)
        bool updated = setCursorFromCoordinates(cur, x, cur.bv().workHeight() - 
1);
        if (updated)
                cur.bv().update();
-       updated |= cursorDown(cur);
+
+       if (cur.inMathed())
+               updated |= cur.down();
+       else
+               updated |= cursorDown(cur);
 
        if (cpar == cur.pit() && cpos == cur.pos()) {
                // we have a row which is taller than the workarea. The
                // simplest solution is to move to the next row instead.
-               updated |= cursorDown(cur);
+               if (cur.inMathed())
+                       updated |= cur.down();
+               else
+                       updated |= cursorDown(cur);
        }
 
        cur.bv().updateScrollbar();

Reply via email to