]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathMacroTemplate.cpp
Fix regression of 18779013 for \smash
[lyx.git] / src / mathed / MathMacroTemplate.cpp
index 62c681be826a61c125edd917ce8eb0f7a2b8d255..53cec03f740a9d84efad953d48192a6a910bc900 100644 (file)
@@ -620,10 +620,13 @@ void MathMacroTemplate::edit(Cursor & cur, bool front, EntryDirection entry_from
 
 bool MathMacroTemplate::notifyCursorLeaves(Cursor const & old, Cursor & cur)
 {
+       unsigned int const nargs_before = nargs();
        commitEditChanges(cur, old);
        updateLook();
        cur.screenUpdateFlags(Update::Force);
-       return InsetMathNest::notifyCursorLeaves(old, cur);
+       // If we have removed a cell, we might have invalidated the cursor
+       return InsetMathNest::notifyCursorLeaves(old, cur)
+               || nargs() < nargs_before;
 }