]> git.lyx.org Git - features.git/commitdiff
Redo metrics after cancelling macro mode
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 24 Apr 2018 12:03:35 +0000 (14:03 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 24 Apr 2018 12:03:35 +0000 (14:03 +0200)
When the cursor is inside a subscript that may become empty, metrics
issues can happen. This patch fixes the issue, although it is not
clear to see what the problem is.

Still, requesting a metrics update also in the case where the macro
mode is canceled makes sense.

Fixes bug #11125.

src/Cursor.cpp

index f3fccfa98e4803afff5f247413a70d92f2ecc3ac..9b5559ae9969f7d8464163d8faf6b9307ccc3948 100644 (file)
@@ -1690,14 +1690,15 @@ bool Cursor::macroModeClose(bool cancel)
        --pos();
        cell().erase(pos());
 
-       // do nothing if the macro name is empty
-       if (s == "\\" || cancel)
-               return false;
-
        // trigger updates of macros, at least, if no full
        // updates take place anyway
        screenUpdateFlags(Update::Force);
 
+       // do nothing if the macro name is empty
+       if (s == "\\" || cancel) {
+               return false;
+       }
+
        docstring const name = s.substr(1);
        InsetMathNest * const in = inset().asInsetMath()->asNestInset();
        if (in && in->interpretString(*this, s))