Skip to content

Commit

Permalink
Merge pull request #91 from cvut/fix-broken-editor-focus-on-line-wrap
Browse files Browse the repository at this point in the history
GUI: Fix editor line focus with wrapped lines.
  • Loading branch information
jdupak authored Nov 29, 2023
2 parents 3cc293b + 309dea7 commit 59cc0b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/windows/editor/srceditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ bool SrcEditor::saveFile(QString filename) {
}

void SrcEditor::setCursorToLine(int ln) {
QTextCursor cursor(document()->findBlockByLineNumber(ln - 1));
QTextCursor cursor(document()->findBlockByNumber(ln - 1));
setTextCursor(cursor);
}

void SrcEditor::setCursorTo(int ln, int col) {
QTextCursor cursor(document()->findBlockByLineNumber(ln - 1));
QTextCursor cursor(document()->findBlockByNumber(ln - 1));
cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::MoveAnchor, col - 1);
setTextCursor(cursor);
}
Expand Down

0 comments on commit 59cc0b2

Please sign in to comment.