#include "InsetMathRef.h"
#include "Buffer.h"
+#include "buffer_funcs.h"
#include "BufferParams.h"
#include "BufferView.h"
#include "CutAndPaste.h"
{
//lyxerr << "setting label '" << label << "' for row " << row << endl;
if (label_[row]) {
- label_[row]->updateCommand(label);
+ if (label.empty()) {
+ delete label_[row];
+ nonum_[row] = true;
+ label_[row] = dummy_pointer;
+ } else
+ label_[row]->updateCommand(label);
return;
}
InsetCommandParams p(LABEL_CODE);
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()) {
+ cur.recordUndoInset();
+ label(row(cur.idx()), docstring());
+ } else {
+ InsetMathGrid::doDispatch(cur, cmd);
+ return;
+ }
+ break;
+
case LFUN_INSET_INSERT: {
//lyxerr << "arg: " << to_utf8(cmd.argument()) << endl;
// FIXME: this should be cleaned up to use InsetLabel methods directly.