mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 05:33:33 +00:00
"not possible to delete a label of a formula": Press forward delete at the end of a row and the label is deleted. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23610 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
635b2c1cc3
commit
9a9e94bca2
@ -26,6 +26,7 @@
|
||||
#include "InsetMathRef.h"
|
||||
|
||||
#include "Buffer.h"
|
||||
#include "buffer_funcs.h"
|
||||
#include "BufferParams.h"
|
||||
#include "BufferView.h"
|
||||
#include "CutAndPaste.h"
|
||||
@ -492,6 +493,11 @@ void InsetMathHull::label(row_type row, docstring const & label)
|
||||
{
|
||||
//lyxerr << "setting label '" << label << "' for row " << row << endl;
|
||||
if (label_[row]) {
|
||||
if (label.empty()) {
|
||||
delete label_[row];
|
||||
nonum_[row] = true;
|
||||
label_[row] = dummy_pointer;
|
||||
} else
|
||||
label_[row]->updateCommand(label);
|
||||
return;
|
||||
}
|
||||
@ -1175,6 +1181,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()) {
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user