]> git.lyx.org Git - lyx.git/commitdiff
Return true to indicate we might have invalidated the cursor
authorVincent van Ravesteijn <vfr@lyx.org>
Fri, 7 Feb 2014 16:14:36 +0000 (17:14 +0100)
committerVincent van Ravesteijn <vfr@lyx.org>
Fri, 7 Feb 2014 22:04:15 +0000 (23:04 +0100)
If we don't do so, Cursor::notifyCursorLeavesOrEnters might continue with
an invalidated cursor.

Fixes-bug: #8329

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;
 }