Skip to content

Commit

Permalink
more clarification of note after experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
pryrt committed Feb 2, 2024
1 parent 0a9fb54 commit 715caf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/docs/preferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Affects the highlighting of the selected text, which is referred to by the menu
* `☐ Highlight tag attributes`: Any attributes inside the active tag will be highlighted using the style defined in **Style Configurator > Global Styles > Tags attribute**.
* `☐ Highlight comment/php/asp zone`

_Note_: If you select a whole word and have the `☐ Match whole word only` option checkmarked, the Smart Highlighting or Style All Occurrences will match that in other locations only if there is a "word boundary" before and after a potential match (space, punctuation, start/end of line, and similar). If you select multiple whole words (like `whole words`), then it will only match in locations where there is a word boundary before the first word (before `whole`) and a word boundary after the final word `words`. If you have a selection that includes punctuation at the beginning and/or the end of the selection, you are violating the understanding of "whole word" in the selection, because you are not limiting your selection to something that can reasonably be determined to be a "word"; thus, the Smart Highlighting and Style All Occurrences behavior may be somewhat confusing in that situation (and might not even behave identically to each other, because they were implemented in different parts of the Notepad++ source code). If you are selecting mixed puncuation and characters and spaces, these features are more likely to meet your expectations if you do _not_ have `☐ Match whole word only` checkmarked. In general, if what you are selecting is not just a single "word" (group of alphanumeric text), it is recommended to not have that option checkmarked.
_Note_: If you select a whole word and have the `☐ Match whole word only` option checkmarked, the Smart Highlighting or Style All Occurrences will match that in other locations only if there is a "word boundary" before and after a potential match (space, punctuation, start/end of line, and similar). If you select multiple whole words (like `whole words`) with this option, then Smart Highlighting will not match anything, but Style All Occurrences will match in locations where there is a word boundary before the first word (before `whole`) and a word boundary after the final word `words` (so in places like `another whole word here` or `parenthetical (whole word) also`, the `whole word` will be styled). If you have a selection that includes punctuation at the beginning and/or the end of the selection, you are violating the understanding of "whole word" in the selection, because you are not limiting your selection to something that can reasonably be determined to be a "word"; thus, the Smart Highlighting and Style All Occurrences behavior will likely be confusing in that situation (and might not even behave identically to each other). If you are selecting mixed puncuation and characters and spaces, these features are more likely to meet your expectations if you do _not_ have `☐ Match whole word only` checkmarked. In general, if what you are selecting is not just a single "word" (group of alphanumeric text), it is recommended to not have that option checkmarked.

### Print

Expand Down

0 comments on commit 715caf7

Please sign in to comment.