diff --git a/src/CursorSlice.cpp b/src/CursorSlice.cpp index c4b1c72f80..b4352e3ba4 100644 --- a/src/CursorSlice.cpp +++ b/src/CursorSlice.cpp @@ -23,7 +23,7 @@ #include "insets/Inset.h" #include "mathed/InsetMath.h" -#include "mathed/MathData.h" +#include "mathed/MathMacro.h" #include "support/lassert.h" @@ -61,8 +61,10 @@ Paragraph & CursorSlice::paragraph() const pos_type CursorSlice::lastpos() const { LASSERT(inset_, /**/); - return inset_->asInsetMath() ? cell().size() - : (text()->empty() ? 0 : paragraph().size()); + InsetMath const * math = inset_->asInsetMath(); + bool paramless_macro = math && math->asMacro() && !math->asMacro()->nargs(); + return math ? (paramless_macro ? 0 : cell().size()) + : (text()->empty() ? 0 : paragraph().size()); } diff --git a/status.20x b/status.20x index 70f49ff190..b7bd859347 100644 --- a/status.20x +++ b/status.20x @@ -89,6 +89,9 @@ What's new flag by using the same latex backend used for previewing the document instead of always using the plain latex backend. +- Fix crash when dissolving a math macro whose first argument is another + parameterless macro (bug 8105). + * USER INTERFACE