mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-13 20:09:59 +00:00
Allow undoing changes to the name of macros that are already finalized.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30434 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0e6724622f
commit
ce7302098c
@ -808,7 +808,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
cur.insert(arg);
|
cur.insert(arg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Don't record undo steps if we are in macro mode and
|
// Don't record undo steps if we are in macro mode and thus
|
||||||
// cmd.argument is the next character of the macro name.
|
// cmd.argument is the next character of the macro name.
|
||||||
// Otherwise we'll get an invalid cursor if we undo after
|
// Otherwise we'll get an invalid cursor if we undo after
|
||||||
// the macro was finished and the macro is a known command,
|
// the macro was finished and the macro is a known command,
|
||||||
@ -817,14 +817,9 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
// InsetMathFrac -> a pos value > 0 is invalid.
|
// InsetMathFrac -> a pos value > 0 is invalid.
|
||||||
// A side effect is that an undo before the macro is finished
|
// A side effect is that an undo before the macro is finished
|
||||||
// undoes the complete macro, not only the last character.
|
// undoes the complete macro, not only the last character.
|
||||||
if (!cur.inMacroMode()) {
|
// At the time we hit '\' we are not in macro mode, still.
|
||||||
MathMacro const * macro = 0;
|
if (!cur.inMacroMode())
|
||||||
if (cur.pos() > 0 && cmd.argument() != "\\")
|
cur.recordUndoSelection();
|
||||||
macro = cur.inset().asInsetMath()->asMacro();
|
|
||||||
|
|
||||||
if (!macro)
|
|
||||||
cur.recordUndoSelection();
|
|
||||||
}
|
|
||||||
|
|
||||||
// spacial handling of space. If we insert an inset
|
// spacial handling of space. If we insert an inset
|
||||||
// via macro mode, we want to put the cursor inside it
|
// via macro mode, we want to put the cursor inside it
|
||||||
|
Loading…
x
Reference in New Issue
Block a user