On Thu, Apr 07, 2005 at 03:58:00PM +0200, Jean-Marc Lasgouttes wrote:
> >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
> 
> Martin> Here is the patch fixing Helge's unfinished macro up/down bug,
> Martin> as well as making the cursor move properly for HOME/END. Also
> Martin> a slight simplification/dead code removal.
> 
> Martin> Unfortunately I didn't get Page Up/Down to behave, so I left
> Martin> that part out.
> 
> I know I am repeating myself, but we should understand the
> LFUN_FINISHED stuff before doing that. Either it makes sense and we
> should fix it, or it does not, and we should remove it completely.

This is the part that is unrelated to LFUN_FINISHED: it fixes
Helge's bug and does nothing else. It's a crashing bug and this is the
correct fix IMHO*). Agreed?

- Martin

*) Why does the same way it is handled in LFUN_LEFT and LFUN_RIGHT
not work here? It is because for LFUN_UP/DOWN the cursor *goes to
another row*. A new x-coordinate has to be figured out, which uses the
coordinate cache which does not yet have an entry for the inset that
this macro is becoming --> boom. The patch just prevents the cursor
from moving off-row and closes the macro first. (And by "macro" I mean,
like the source, things like bmod and arctan, lyxblacktext thingies not
*user* macros.)

Index: ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/ChangeLog,v
retrieving revision 1.488
diff -u -r1.488 ChangeLog
--- ChangeLog   7 Apr 2005 09:06:08 -0000       1.488
+++ ChangeLog   7 Apr 2005 18:19:16 -0000
@@ -1,5 +1,10 @@
 2005-04-07  Martin Vermeer  <[EMAIL PROTECTED]>
 
+       * math_nestinset.C (doDispatch): Fix arrow up/down inside 
+       macro crashing bug (Helge Hafting report)
+
+2005-04-07  Martin Vermeer  <[EMAIL PROTECTED]>
+
        * math_gridinset.C (getStatus): allow C-Tab to split cell
 
 2005-04-06  Martin Vermeer  <[EMAIL PROTECTED]>
Index: math_nestinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_nestinset.C,v
retrieving revision 1.149
diff -u -r1.149 math_nestinset.C
--- math_nestinset.C    6 Apr 2005 19:01:55 -0000       1.149
+++ math_nestinset.C    7 Apr 2005 18:19:16 -0000
@@ -496,6 +496,12 @@
 
        case LFUN_UPSEL:
        case LFUN_UP:
+               // FIXME Tried to use clearTargetX and macroModeClose, crashed 
on cur.up()
+               if (cur.inMacroMode()) {
+                       // Make Helge happy
+                       cur.macroModeClose();
+                       break;
+               }
                cur.selHandle(cmd.action == LFUN_UPSEL);
                if (!cur.up())
                        cmd = FuncRequest(LFUN_FINISHED_UP);
@@ -505,6 +511,10 @@
 
        case LFUN_DOWNSEL:
        case LFUN_DOWN:
+               if (cur.inMacroMode()) {
+                       cur.macroModeClose();
+                       break;
+               }
                cur.selHandle(cmd.action == LFUN_DOWNSEL);
                if (!cur.down())
                        cmd = FuncRequest(LFUN_FINISHED_DOWN);

Attachment: pgpMgXe5IvuPz.pgp
Description: PGP signature

Reply via email to