Notepad2e
Notepad2e copied to clipboard
Find first/last match indication
After processing Find and Replace commands (called from the dialog or hotkeys, including #38) except "mass" (Grep, Ungrep, Replace All, In Selection), draw up to two horizontal lines within the text area (in all split views) and hide previously drawn lines (if any). They're also hidden when closing the document or deleting the line (text) they're attached to (no need to try to make them very persistent against document changes).
After processing such a command, run two more Find-s (up to the distance used by Highlight Current Selection, i.e. stop early on a large document with no match in that direction). Draw the line above the current line if no match exists before it in the document and met BOF. Draw the line below if there's no match later in the document and met EOF. If there is only one match in the document, both lines will appear (as in the example); if no matches, no lines will appear.
Example:
|foo
bar
foo
After Ctrl+F for bar:
foo
--------
[bar]
--------
foo
For visual example of "the line below", see how Notepad++ indicates a folded region. Line color can be customized via Customize Schemes (as Find Marker (Color), after Long Line Marker; add to 2nd ... too). Default color is #FFCCCC.
Together with this implementation, remove all code for the old feature of changing the Find toolbar icon and window flashing (both described in #378) and clear (make transparent) the "stop" icon in Toolbar*.bmp (will use this space for a new icon in the future). Those features are not going to come back so consider refactoring to remove hacks needed for them.
Done.
If there is only one match in the document, both lines will appear (as in the example); if no matches, no lines will appear.
Open Ctrl+F, type something that doesn't exist in the document, F3, see a message (or no, if it's disabled) then close the dialog - the first line in the document will have an overline and an underline (it should have none). Instead of closing the dialog, you can also just focus the main window for the same effect.
Also, lines are currently drawn under the logical line, i.e. when a line is wrapped then the line appears under the line and all sublines. This is confusing; instead, draw a single line according to search direction, i.e. either above the line (first subline) - if Find Previous, or under the last subline - if Find Next.