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.

(cherry picked from commit 68ec34e603)
This commit is contained in:
Jean-Marc Lasgouttes 2018-04-24 14:03:35 +02:00
parent 4f0504d778
commit d0a11cb8e2
2 changed files with 8 additions and 4 deletions

View 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))

View 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