Skip to content

Commit

Permalink
Fix search selection when text changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dman95 committed Feb 6, 2022
1 parent cfd3ba0 commit 7315d15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ void MainWindow::newFile()
tabs->addTab(tab, tr("New"));
tabs->setCurrentWidget(tab);
connect(tab->code, SIGNAL(textChanged()), this, SLOT(setProgramBuildedFlagToFalse()));
connect(tab->code, SIGNAL(textChanged()), this, SLOT(findNextAfterTextChange()));
connect(tab->code, SIGNAL(modificationChanged(bool)), this, SLOT(changeCurrentSavedState(bool)));
connect(tab->code, SIGNAL(fileOpened(QString)), this, SLOT(openFile(QString)));
}
Expand Down Expand Up @@ -1537,6 +1538,11 @@ void MainWindow::find()
findDialog->activateWindow();
}

void MainWindow::findNextAfterTextChange()
{
findNext(QString(), Qt::CaseSensitive, true, false);
}

void MainWindow::findNext(const QString &pattern, Qt::CaseSensitivity cs, bool all,
bool replace, const QString &replaceText)
{
Expand Down
1 change: 1 addition & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ public slots:
void find();
void findNext(const QString &pattern, Qt::CaseSensitivity cs, bool all, bool replace,
const QString &replaceText = 0);
void findNextAfterTextChange();

//! Settings
void restorePrevSession(bool notNotify = false);
Expand Down

0 comments on commit 7315d15

Please sign in to comment.