mirror of
https://github.com/KDE/konsole.git
synced 2025-12-23 23:38:08 -05:00
Move variable inwards and closer to initialization
This commit is contained in:
committed by
Christoph Cullmann
parent
9b5693b749
commit
70643e4006
@@ -42,7 +42,6 @@ void SearchHistoryTask::executeOnScreenWindow(const QPointer<Session> &session,
|
||||
Emulation *emulation = session->emulation();
|
||||
|
||||
if (!_regExp.pattern().isEmpty()) {
|
||||
int pos = -1;
|
||||
bool forwards = (_direction == Enum::ForwardsSearch);
|
||||
const int lastLine = window->lineCount() - 1;
|
||||
|
||||
@@ -157,11 +156,7 @@ void SearchHistoryTask::executeOnScreenWindow(const QPointer<Session> &session,
|
||||
// line number search below assumes that the buffer ends with a new-line
|
||||
string.append(QLatin1Char('\n'));
|
||||
|
||||
if (forwards) {
|
||||
pos = string.indexOf(_regExp);
|
||||
} else {
|
||||
pos = string.lastIndexOf(_regExp);
|
||||
}
|
||||
const auto pos = forwards ? string.indexOf(_regExp) : string.lastIndexOf(_regExp);
|
||||
|
||||
// if a match is found, position the cursor on that line and update the screen
|
||||
if (pos != -1) {
|
||||
|
||||
Reference in New Issue
Block a user