Skip to content

Commit

Permalink
[Bugfix] Fix moving text cursor to the first position crashes the
Browse files Browse the repository at this point in the history
program
  • Loading branch information
IoeCmcomc committed Jul 28, 2023
1 parent ed4d403 commit c33c92e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/codeeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c33c92e

Please sign in to comment.