diff --git a/src/codeeditor.cpp b/src/codeeditor.cpp index 5d5a5638..8509d9ac 100644 --- a/src/codeeditor.cpp +++ b/src/codeeditor.cpp @@ -336,7 +336,10 @@ void CodeEditor::startOfWordExtended(QTextCursor &tc) const { //debugTextCursor(tc); // This fixes garbage characters in debug mode const QString &&selectedText = tc.selectedText(); - const QChar &curChar = selectedText.front(); + if (selectedText.isEmpty()) { + return; + } + const QChar &curChar = selectedText.front(); if (extendedAcceptedCharsset.contains(curChar)) { tc.movePosition(QTextCursor::PreviousCharacter);