From 5bce66b1a38be7c7e622d57d896e1106ed3b48e0 Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Fri, 14 Aug 2020 21:28:24 +0200 Subject: [PATCH] #6401 more robust processing on special char code insets when looking for spell checker ranges --- src/Paragraph.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 45cc80ef6a..99ab12967f 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -4503,7 +4503,18 @@ Language * Paragraph::Private::locateSpellRange( while (last < to && samelang && sameinset) { // hop to end of word while (last < to && !owner_->isWordSeparator(last)) { - if (owner_->getInset(last)) { + Inset const * inset = owner_->getInset(last); + if (inset && inset->lyxCode() == SPECIALCHAR_CODE) { + // check for "invisible" letters such as ligature breaks + odocstringstream os; + inset->toString(os); + if (os.str().length() != 0) { + // avoid spell check of visible special char insets + // stop the loop in front of the special char inset + sameinset = false; + break; + } + } else if (inset) { appendSkipPosition(skips, last); } else if (owner_->isDeleted(last)) { appendSkipPosition(skips, last); -- 2.39.5