]> 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>
Wed, 25 Apr 2018 15:03:50 +0000 (17: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.

(cherry picked from commit 68ec34e60343a5dec9f32d60c79a2c0825b62d12)

src/Cursor.cpp
status.23x

index 91df9d68876a54f34df79940dac2576c328f0f8b..92c9bdda2639161664d5b3d31efa6b85e851e1c1 100644 (file)
@@ -1412,14 +1412,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))
index 38395b2a4afacf7e8b3d7a301109edf2927f1cd3..af3b8517e6605088dc33e3fcef2a579a6337fd5e 100644 (file)
@@ -219,6 +219,9 @@ What's new
 - When adding a label in the first paragraph after a division (section,
   etc), use the label prefix for it (bug 10624).
 
+- Fix crash when canceling entry of macro name in a mathed subscript
+  (bug 11125).
+
 
 * INTERNALS