Martin,
what is this fix for bug 1981 supposed to do?
        case LFUN_CUT:
+               cur.pos() = 0; // Prevent stale position >= size crash
                cutSelection(cur, true, true);
                cur.message(_("Cut"));
                break;

It is the cause of a rather silly behaviour: when you cut a selected string 
from a math nestinset, not only the selection, but also everything preceeding 
it will be cut.

IMO (and I'm pretty sure) the correct fix is to use cur.normalize() instead, 
which fixes the cursor position if it is outside the size() range. I have 
tested that it fixes both bug 1981 and bug 1960, which seem to share the 
cause.

Can this go in?

Jürgen
Index: math_nestinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_nestinset.C,v
retrieving revision 1.166
diff -u -r1.166 math_nestinset.C
--- math_nestinset.C	19 Aug 2005 12:57:47 -0000	1.166
+++ math_nestinset.C	16 Sep 2005 10:39:01 -0000
@@ -423,9 +423,10 @@
 	}
 
 	case LFUN_CUT:
-		cur.pos() = 0; // Prevent stale position >= size crash
 		cutSelection(cur, true, true);
 		cur.message(_("Cut"));
+		// Prevent stale position >= size crash
+		cur.normalize();
 		break;
 
 	case LFUN_COPY:

Reply via email to