Convert 'if' to 'else if' to remove a no-op
This commit is contained in:
parent
9de2db2fb8
commit
92a578f5e8
@ -93,10 +93,8 @@ FilteredTextEdit::keyPressEvent(QKeyEvent *event)
|
|||||||
++history_index_;
|
++history_index_;
|
||||||
setPlainText(working_history_[history_index_]);
|
setPlainText(working_history_[history_index_]);
|
||||||
moveCursor(QTextCursor::End);
|
moveCursor(QTextCursor::End);
|
||||||
}
|
} else if (textCursor() == initial_cursor) {
|
||||||
|
// Move to the start of the text if there aren't any lines to move up to.
|
||||||
// Move to the start of the text if there aren't any lines to move up to.
|
|
||||||
if (textCursor() == initial_cursor) {
|
|
||||||
initial_cursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor, 1);
|
initial_cursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor, 1);
|
||||||
setTextCursor(initial_cursor);
|
setTextCursor(initial_cursor);
|
||||||
}
|
}
|
||||||
@ -111,10 +109,8 @@ FilteredTextEdit::keyPressEvent(QKeyEvent *event)
|
|||||||
--history_index_;
|
--history_index_;
|
||||||
setPlainText(working_history_[history_index_]);
|
setPlainText(working_history_[history_index_]);
|
||||||
moveCursor(QTextCursor::End);
|
moveCursor(QTextCursor::End);
|
||||||
}
|
} else if (textCursor() == initial_cursor) {
|
||||||
|
// Move to the end of the text if there aren't any lines to move down to.
|
||||||
// Move to the end of the text if there aren't any lines to move down to.
|
|
||||||
if (textCursor() == initial_cursor) {
|
|
||||||
initial_cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor, 1);
|
initial_cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor, 1);
|
||||||
setTextCursor(initial_cursor);
|
setTextCursor(initial_cursor);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user