On Tue, 2005-08-16 at 12:07, Martin Vermeer wrote: > On Fri, 2005-08-12 at 18:33, Mark van Rossum wrote: > > Hi > > > > I try to insert brackets (e.g. \left{ and \right} in Latex lingo) in > > a multi-line equation (equation array). > > I would like the brackets to encompass multiple lines. > > > > I select multiple lines and with 'Math Panel' I insert the brackets. > > Next, what happens depends on the details: > > > > Crash: when the selection includes both l.h.s. (left hand side) and > > r.h.s of the equation. > > > > Part of the equation are deleted: when the selection contains multiple > > rhs lines. > > > > Already a workaround would help me. However, I type \left{ , it seems to > > automatically insert both left and right brackets. > > > > (This will be tricky, as Latex requires the \left. and \right. if I > > remember correctly). > > > > System: i686 Lyx 1.3.6 on FC4 lyx-1.3.6-1.fc4.rpm > > This is a special case of a more general crashing bug. > > Cutting or copying a selection will crash every time in a multi-line > equation, if the selection extends over more than one line. This is now > bug 1981 (and bugzilla's disk is full :-( ) > > Once this bug is fixed, a workaround will be to separately create a pair > of {} within math, and cut&paste the multi-line equation into it. > > > - Martin
Attached the fix for both. The first chunk fixes the crash problem 1981; again a pos() from underneath which the string to which it belongs has disappeared ;-) The second chunk makes it impossible to insert a pair of delims etc. "around" a selection that contains multiple cells. (It would be better to make this work properly instead; but that is not for now. It is better disabled than working wrongly and deleting stuff on the unsuspecting user.) Note that you still have the "cases" environment, and can put delimiters around a math matrix inserted via the math panel. OK to commit? - Martin
Index: math_nestinset.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_nestinset.C,v retrieving revision 1.165 diff -u -p -r1.165 math_nestinset.C --- math_nestinset.C 18 Jul 2005 00:45:10 -0000 1.165 +++ math_nestinset.C 16 Aug 2005 10:45:08 -0000 @@ -423,6 +423,7 @@ void MathNestInset::doDispatch(LCursor & } case LFUN_CUT: + cur.pos() = 0; // Prevent stale position >= size crash cutSelection(cur, true, true); cur.message(_("Cut")); break; @@ -814,7 +815,9 @@ void MathNestInset::doDispatch(LCursor & if (rs.empty()) rs = ')'; recordUndo(cur, Undo::ATOMIC); - cur.handleNest(MathAtom(new MathDelimInset(ls, rs))); + // Don't do this with multi-cell selections + if (cur.selBegin().idx() == cur.selEnd().idx()) + cur.handleNest(MathAtom(new MathDelimInset(ls, rs))); break; }
signature.asc
Description: This is a digitally signed message part