Skip to content

Commit 7315d15

Browse files
committed
Fix search selection when text changes
1 parent cfd3ba0 commit 7315d15

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

mainwindow.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ void MainWindow::newFile()
576576
tabs->addTab(tab, tr("New"));
577577
tabs->setCurrentWidget(tab);
578578
connect(tab->code, SIGNAL(textChanged()), this, SLOT(setProgramBuildedFlagToFalse()));
579+
connect(tab->code, SIGNAL(textChanged()), this, SLOT(findNextAfterTextChange()));
579580
connect(tab->code, SIGNAL(modificationChanged(bool)), this, SLOT(changeCurrentSavedState(bool)));
580581
connect(tab->code, SIGNAL(fileOpened(QString)), this, SLOT(openFile(QString)));
581582
}
@@ -1537,6 +1538,11 @@ void MainWindow::find()
15371538
findDialog->activateWindow();
15381539
}
15391540

1541+
void MainWindow::findNextAfterTextChange()
1542+
{
1543+
findNext(QString(), Qt::CaseSensitive, true, false);
1544+
}
1545+
15401546
void MainWindow::findNext(const QString &pattern, Qt::CaseSensitivity cs, bool all,
15411547
bool replace, const QString &replaceText)
15421548
{

mainwindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ public slots:
269269
void find();
270270
void findNext(const QString &pattern, Qt::CaseSensitivity cs, bool all, bool replace,
271271
const QString &replaceText = 0);
272+
void findNextAfterTextChange();
272273

273274
//! Settings
274275
void restorePrevSession(bool notNotify = false);

0 commit comments

Comments
 (0)