From 68ec34e60343a5dec9f32d60c79a2c0825b62d12 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 24 Apr 2018 14:03:35 +0200 Subject: [PATCH] Redo metrics after cancelling macro mode 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 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Cursor.cpp b/src/Cursor.cpp index f3fccfa98e..9b5559ae99 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -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)) -- 2.39.5