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

When doing a "Find All in Current Document", there are cases where it wouldn't highlight correctly #4887

Open
tommai78101 opened this issue Sep 28, 2018 · 3 comments

Comments

@tommai78101
Copy link

tommai78101 commented Sep 28, 2018

Description of the Issue

I don't know if this is by design, or this is an incorrect behavior. So I'm just going to report what I have observed, and no questions are asked.

This is what is happening when certain situations arises when attempting to do a "Find All in Current Document" search:

gif

The RegExp search was used, and the values are \s+[2-9]\r?\n, as shown in the GIF.

This happens after searching and typing in text in the document.

Steps to Reproduce the Issue

  1. Have any text document available.
  2. CTRL+F/CMD+F to start a "Find and Search".
  3. Enable "Regular Expressions".
  4. Type in any regular expressions matching any tokens in the currently opened document. It needs to guarantee Notepad++ can find it at least once.
  5. Click on the "Find All in Current Document" button.
  6. In the current document, the "Find Result" should be opened at the bottom.
  7. At the top of the document, press TAB key 3 times.
  8. Double-click on any of the found instances in the "Find Result" pane.
  9. Observe the highlighting now shifted away from where it should be highlighted before.

Expected Behavior

It should highlight the found search tokens, even when the document has been modified after the search, when double-clicking on any of the results.

Actual Behavior

The highlights are incorrectly highlighting certain areas of the document, after double-clicking on it.

Debug Information

Notepad++ v7.5.8 (64-bit)
Build time : Jul 23 2018 - 02:06:36
Path : C:\Program Files\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS : Windows 10 (64-bit)
Plugins : DSpellCheck.dll mimeTools.dll NppConverter.dll

@sasumner
Copy link
Contributor

I don't know if this is by design, or this is an incorrect behavior.

"by design"...although maybe more like observed behavior after implementation. :-)

"incorrect behavior"...you be the judge (well, I guess you already were). :-)

Two "cures": a) after doing a FACD, don't use the results after you modify the document; b) work with the results bottom-up, changing only text between the match and the previous match (that way all prior matches don't "move" on you).

@tommai78101
Copy link
Author

tommai78101 commented Sep 28, 2018

Well I do know of a workaround, and that is to press F3, or Shift+F3.

It's more of a situational workaround than a problem/solution workaround.

UPDATE:

I should explain a bit more. This workaround is only useful to incrementally/decrementally navigate through all of the search results and modify the document while continuing to search/find the results on subsequent attempts.

@sasumner
Copy link
Contributor

FindNext / Find Previous only work if you haven't used another search term after the FACD was run. I thought that the act of using (e.g. double-clicking) a result line from the Find result panel would cause FindNext / Prev 's remembered value to be refreshed to THAT search term (the one that appears as xxx in 'Search "xxx" (# hits in 1 file)', but no.

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