From: André Pönitz Date: Wed, 10 Dec 2003 10:22:27 +0000 (+0000) Subject: Martin's patch forn symmetric behaviour on backspace/erase X-Git-Tag: 1.6.10~15671 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=ea03d868c4f6a2450589e610a0b76fcefba206c4;p=features.git Martin's patch forn symmetric behaviour on backspace/erase git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8222 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 2d3400a699..726fcce0b9 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -464,17 +464,24 @@ bool MathCursor::erase() if (inset()->idxDelete(idx())) return true; - // old behaviour when in last position of cell + // special behaviour when in last position of cell if (pos() == size()) { - if (inset()->ncols() == 1 && inset()->nrows() == 1 && depth() == 1 && size() == 0) + bool one_cell = inset()->ncols() == 1 && inset()->nrows() == 1; + if (one_cell && depth() == 1 && size() == 0) return false; - else{ + // remove markup + if (one_cell) + pullArg(); + else inset()->idxGlue(idx()); - return true; - } + return true; } - plainErase(); + if (hasNextAtom() && nextAtom()->nargs() > 0) + right(true); + else + plainErase(); + return true; }