From ea03d868c4f6a2450589e610a0b76fcefba206c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 10 Dec 2003 10:22:27 +0000 Subject: [PATCH] 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 --- src/mathed/math_cursor.C | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) 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; } -- 2.39.2