functions to get information about the current matching texts of a SearchQuery #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In my editor, the search and replace dialog has a text showing information about the current match and the total number of texts matching. Something like "Occurence #3 of 23 matching texts".
I noticed you don't want to expose the
decofield of decorations of the currentSearchState.So I'm proposing these functions to expose those infos, while keeping the decorations hidden:
Why not though? Wouldn't a getter that returns the decoration set be a lot easier and more efficient than this set of different function, which copy the ranges every time you read them?
When I saw this:
the first change I made to get the number of matching texts was this:
Then I asked myself why you did not do that, and the explanation I gave was that you did not want to expose the decorations, though
getSearchStatedoes return a completeSearchState, only as a more generic object, hiding the decorations in the return type of the function.If I understand right, now you are saying something like this:
without the need to export the
SearchStateclass.I've pushed a patch that adds a
getMatchHighlightsfunction (and tagged a version 0.1.0).