Skip to content

SmartHighlighter: whole word limitation? #426

@Tiax

Description

@Tiax

This has bothered me for a while now: it's about the constraints the SmartHighlighter has in place, i.e. finding occurrences in the active editor, when text is selected.

I would expect it to automatically highlight all occurrences of "FOO" in a snippet like

1 FOO BAR
2 FOOBAR
3 BARFOO
4 FOO-BAR
5 BAR_FOO

when any of the "FOO"s is selected, yet it only highlights the one succeeded by the minus in line 4 and only when selecting any "FOO" surrounded by word-boundaries.

From the SmartHighlighter.cpp

//The word has to consist if wordChars only, and the characters before and after something else
FindOption fo;
fo._isMatchCase = nppGUI._smartHiliteCaseSensitive;
fo._isWholeWord = true;

I assume the whole word matching is there for performance reasons? Could we get a switch for this anyway, as already exists for the case-sensitive option?

Metadata

Metadata

Assignees

Labels

enhancementProposed enhancements of existing features

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions