From fc6b8c64f8599df99098c371a70c4a3fc075be94 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Fri, 7 Feb 2014 17:14:36 +0100 Subject: [PATCH] Return true to indicate we might have invalidated the cursor If we don't do so, Cursor::notifyCursorLeavesOrEnters might continue with an invalidated cursor. Fixes-bug: #8329 --- src/mathed/MathMacroTemplate.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mathed/MathMacroTemplate.cpp b/src/mathed/MathMacroTemplate.cpp index 62c681be82..53cec03f74 100644 --- a/src/mathed/MathMacroTemplate.cpp +++ b/src/mathed/MathMacroTemplate.cpp @@ -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; } -- 2.39.2