From f299d5a245e7033137721353c4e3de7e0857812d Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Sun, 27 Aug 2023 23:52:46 +0200 Subject: [PATCH] Fix KF6 crash in emoji completion --- src/models/completionmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/completionmodel.cpp b/src/models/completionmodel.cpp index fbc0deece..dca0c7732 100644 --- a/src/models/completionmodel.cpp +++ b/src/models/completionmodel.cpp @@ -145,7 +145,7 @@ void CompletionModel::updateCompletion() m_filterModel->setFullText(m_fullText); m_filterModel->setFilterText(m_text); m_filterModel->invalidate(); - } else if (text().startsWith(QLatin1Char(':')) && !text()[1].isUpper() + } else if (text().startsWith(QLatin1Char(':')) && text().size() > 1 && !text()[1].isUpper() && (m_fullText.indexOf(QLatin1Char(':'), 1) == -1 || (m_fullText.indexOf(QLatin1Char(' ')) != -1 && m_fullText.indexOf(QLatin1Char(':'), 1) > m_fullText.indexOf(QLatin1Char(' '), 1)))) { m_filterModel->setSourceModel(m_emojiModel);