diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 3c8e878c0b..627159826a 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -3383,7 +3383,7 @@ int Buffer::spellCheck(DocIterator & from, DocIterator & to, for (; from != end; from.forwardPos()) { // We are only interested in text so remove the math CursorSlice. while (from.inMathed()) - from.pop_back(); + from.forwardInset(); to = from; if (from.paragraph().spellCheck(from.pos(), to.pos(), wl, suggestions)) break;