Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backward direction not work in Find #628

Closed
accessv opened this issue Aug 18, 2024 · 3 comments
Closed

Backward direction not work in Find #628

accessv opened this issue Aug 18, 2024 · 3 comments

Comments

@accessv
Copy link
Contributor

accessv commented Aug 18, 2024

Operating System and Version

macOs

Distribution

brew

Description

With and without the selection of the "Backward direction" in the Find dialog window, the search will be only in the forward direction.

Steps to Reproduce

  1. open the Find window (command + F)
  2. set finding pattern
  3. set check on Backward direction
  4. the search will be in a forward direction

Additional Details

e.g. screenshots, logs, etc

@accessv
Copy link
Contributor Author

accessv commented Aug 19, 2024

That is a fix for the issue.

--- a/src/NotepadNext/dialogs/FindReplaceDialog.cpp
+++ b/src/NotepadNext/dialogs/FindReplaceDialog.cpp
@@ -222,7 +222,13 @@ void FindReplaceDialog::find()

     prepareToPerformSearch();

-    Sci_CharacterRange range = finder->findNext();
+    Sci_CharacterRange range;
+    if(!ui->checkBoxBackwardsDirection->isChecked()) {
+        range = finder->findNext();
+    }
+    else{
+         range = finder->findPrev();
+    }

     if (ScintillaNext::isRangeValid(range)) {
         if (finder->didLatestSearchWrapAround()) {

@dail8859
Copy link
Owner

@accessv Could you open a PR with these changes? I'd be happy to review/test!

@dail8859
Copy link
Owner

Closed by #635

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

No branches or pull requests

2 participants