commit 86191314cba5f74af233e10af70cd80a06f03a78
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Wed Jan 13 11:41:29 2021 +0100

    Record undo properly when inserting math script
    
    The current code did not always record undo at the right level.
    
    Fixes bug #10843.
---
 src/mathed/InsetMathNest.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index 8efa118..2f4df74 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -898,7 +898,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & 
cmd)
                if (cmd.argument().empty()) {
                        // do superscript if LyX handles
                        // deadkeys
-                       cur.recordUndoSelection();
+                       cur.recordUndoInset();
                        script(cur, true, grabAndEraseSelection(cur));
                }
                break;
@@ -1874,10 +1874,12 @@ bool InsetMathNest::interpretChar(Cursor & cur, 
char_type const c)
                return true;
        } else if (currentMode() != InsetMath::TEXT_MODE) {
                if (c == '_') {
+                       cur.recordUndoInset();
                        script(cur, false, save_selection);
                        return true;
                }
                if (c == '^') {
+                       cur.recordUndoInset();
                        script(cur, true, save_selection);
                        return true;
                }
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to