diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 1aea13f2b9..0d9c790f2e 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -29,6 +29,7 @@ #include "Text.h" #include "Buffer.h" +#include "buffer_funcs.h" #include "BufferParams.h" #include "BufferView.h" #include "CutAndPaste.h" @@ -442,7 +443,11 @@ docstring InsetMathHull::label(row_type row) const void InsetMathHull::label(row_type row, docstring const & label) { //lyxerr << "setting label '" << label << "' for row " << row << endl; - label_[row] = label; + if (label.empty()) { + nonum_[row] = true; + label_[row].clear(); + } else + label_[row] = label; } @@ -1119,6 +1124,19 @@ void InsetMathHull::doDispatch(Cursor & cur, FuncRequest & cmd) break; } + case LFUN_WORD_DELETE_FORWARD: + case LFUN_CHAR_DELETE_FORWARD: + if (col(cur.idx()) + 1 == ncols() + && cur.pos() == cur.lastpos() + && !label(row(cur.idx())).empty()) { + recordUndoInset(cur); + label(row(cur.idx()), docstring()); + } else { + InsetMathGrid::doDispatch(cur, cmd); + return; + } + break; + case LFUN_INSET_INSERT: { //lyxerr << "arg: " << to_utf8(cmd.argument()) << endl; std::string const name = cmd.getArg(0); diff --git a/status.15x b/status.15x index e5309973f2..9f6138c3a9 100644 --- a/status.15x +++ b/status.15x @@ -80,6 +80,8 @@ What's new * USER INTERFACE: +- Allow deleting a label in a formula with the delete key (bug 2556). + - Allow to enter starred math commands such as \tag* (bug 4584). - Load amsmath when \tag or \tag* is used (bug 4586).