Skip to content

Add QuickFindNext action (Ctrl+F3) - #1104

Open
PCCV wants to merge 1 commit into
dail8859:masterfrom
PCCV:add-quickfindnext
Open

Add QuickFindNext action (Ctrl+F3)#1104
PCCV wants to merge 1 commit into
dail8859:masterfrom
PCCV:add-quickfindnext

Conversation

@PCCV

@PCCV PCCV commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Description:

This adds the QuickFindNext action, present in Notepad++ but missing in NotepadNext.

Behavior:

pressing Ctrl+F3 searches for the next occurrence of the word under the cursor (or the current selection, if any), without opening the Find dialog — matching Notepad++'s existing behavior.

This PR builds on top of the recently merged Fix Unfold All action (#1103).

Changes:

Added actionQuickFindNext and wired it to the corresponding search logic
MainWindow.cpp — Modify the showFindReplaceDialog function to prevent the dialog box from opening.
MainWindow..h — change prototype of MainWindow::showFindReplaceDialog
Updated MainWindow.ui to register the new action and its shortcut (Ctrl+F3)

@dail8859 dail8859 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is using settings already in the dialog and messing with the search. For example if "backwards" is selected in the find dialog then the search is going backwards. Same with if regex is selected. If there is a special character it will do a regex search, then when Ctrl+F3 is pressed again it doesn't give you expected results.

For example, selecting "0.25" will find "0125" but then pressing Ctrl+F3 won't find "0.25".


connect(ui->actionQuickFindNext, &QAction::triggered, this, [=,this]() {
showFindReplaceDialog(FindReplaceDialog::FIND_TAB, false);
FindReplaceDialog *f = findChild<FindReplaceDialog *>(QString(), Qt::FindDirectChildrenOnly);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is not needed

}

void MainWindow::showFindReplaceDialog(int index)
void MainWindow::showFindReplaceDialog(int index, bool show)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having a function called "show X" that takes a variable to not show it is a code smell so likely something needs refactored.

Comment on lines +1664 to +1667
if (! show) {
frd->find();
frd->reject();
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hurts my eyes. The entire dialog flashes on the screen since it is being shown then hidden quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants