On Mon, Dec 08, 2003 at 11:40:48AM +0100, Andre Poenitz spake thusly: > Index: math_cursor.C > =================================================================== > RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_cursor.C,v > retrieving revision 1.368 > diff -u -p -r1.368 math_cursor.C > --- math_cursor.C 1 Nov 2003 15:45:18 -0000 1.368 > +++ math_cursor.C 8 Dec 2003 10:37:07 -0000 > @@ -436,8 +436,12 @@ bool MathCursor::backspace() > } > } > > - --pos(); > - plainErase(); > + if (hasPrevAtom() && prevAtom()->nargs() > 0) > + left(true); > + else { > + --pos(); > + plainErase(); > + } > return true; > } >
Wot?!? That's *six* lines! (Okokok, only four lines essentially changed.) Seems to work. Put it in, nice feature. - Martin BTW should we have symmetric behaviour? I.e. pressing 'delete' on the inside of the right of a parentheses pair would 'melt' the pair. But it seems this is already bound... Anyway, see attached. - Martin
Index: math_cursor.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_cursor.C,v retrieving revision 1.368 diff -u -p -r1.368 math_cursor.C --- math_cursor.C 1 Nov 2003 15:45:18 -0000 1.368 +++ math_cursor.C 9 Dec 2003 08:49:07 -0000 @@ -462,13 +466,22 @@ bool MathCursor::erase() if (pos() == size()) { if (inset()->ncols() == 1 && inset()->nrows() == 1 && depth() == 1 && size() == 0) return false; - else{ - inset()->idxGlue(idx()); + else { + if (inset()->ncols() == 1 && inset()->nrows() == 1) + pullArg(); + else { + inset()->idxGlue(idx()); + } return true; } } - plainErase(); + if (hasNextAtom() && nextAtom()->nargs() > 0) + right(true); + else { + plainErase(); + } + return true; }
pgp00000.pgp
Description: PGP signature