[libraries/ktextaddons] textcustomeditor/plaintexteditor: Revert this part of previous patch

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 3c74ceda72d2de50b71388724d87b2aec0d07be4 by Laurent Montel.
Committed on 09/08/2026 at 20:51.
Pushed by mlaurent into branch 'master'.

Revert this part of previous patch

M  +3    -1    textcustomeditor/plaintexteditor/plaintextsyntaxspellcheckinghighlighter.cpp

https://invent.kde.org/libraries/ktextaddons/-/commit/3c74ceda72d2de50b71388724d87b2aec0d07be4

diff --git a/textcustomeditor/plaintexteditor/plaintextsyntaxspellcheckinghighlighter.cpp b/textcustomeditor/plaintexteditor/plaintextsyntaxspellcheckinghighlighter.cpp
index 26788234f..7461c8ef8 100644
--- a/textcustomeditor/plaintexteditor/plaintextsyntaxspellcheckinghighlighter.cpp
+++ b/textcustomeditor/plaintexteditor/plaintextsyntaxspellcheckinghighlighter.cpp
@@ -157,7 +157,9 @@ void PlainTextSyntaxSpellCheckingHighlighter::setMisspelled(int start, int count
 void PlainTextSyntaxSpellCheckingHighlighter::applyFormat(int offset, int length, const KSyntaxHighlighting::Format &format)
 {
     if (format.spellCheck() && length > 0) {
-        if (d->spellCheckRanges.back().end() + 1 == offset) {
+        if (d->spellCheckRanges.empty()) {
+            d->spellCheckRanges.emplace_back(offset, length);
+        } else if (d->spellCheckRanges.back().end() + 1 == offset) {
             d->spellCheckRanges.back().length += length;
         } else {
             d->spellCheckRanges.emplace_back(offset, length);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.