Skip to content

Find first/last match indication #388

@ProgerXP

Description

@ProgerXP

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions