Add QuickFindNext action (Ctrl+F3) - #1104
Conversation
dail8859
left a comment
There was a problem hiding this comment.
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); |
| } | ||
|
|
||
| void MainWindow::showFindReplaceDialog(int index) | ||
| void MainWindow::showFindReplaceDialog(int index, bool show) |
There was a problem hiding this comment.
Having a function called "show X" that takes a variable to not show it is a code smell so likely something needs refactored.
| if (! show) { | ||
| frd->find(); | ||
| frd->reject(); | ||
| } |
There was a problem hiding this comment.
This hurts my eyes. The entire dialog flashes on the screen since it is being shown then hidden quickly.
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)