ProgerXP / Notepad2e

Word highlighting, simultaneous editing, split views, math evaluation, un/grep, comment reformatting, UAC elevation, complete regexps (PCRE), Lua lexers, DPI awareness and more (XP+)
Other
370 stars 52 forks source link

Find - disable Match whole/beginning of word when Regexp is checked #439

Closed ProgerXP closed 1 year ago

ProgerXP commented 1 year ago

Enabling Regexp search is incompatible with Match whole word and Match beginning of word. When Regexp is checked, those two are disabled and their check marks disappear even though if you subsequently disable Regexp, they will reappear. This is especially confusing due to the feature of Ctrl+F3 that disables Regexp search - if user has previously noticed that Regexp is on while Match are (visually) off, he doesn't expect Ctrl+F3 to search with Match on (yet this is what happens).

Because Regexp search isn't automatically enabled, the only way to turn it on is by user clicking on it or using an accelerator. Therefore when this happens, uncheck Match whole word and Match beginning of word in addition to disabling them.

cshnik commented 1 year ago

Fixed.

ProgerXP commented 1 year ago

Changes done in scope of this issue:

ProgerXP commented 1 year ago

Ctrl+F3 now unsets not only the Regexp flag but also the two Word flags

On the second thought, unconditionally clearing Word flags is wrong because user could have enabled one of them without enabling Regexp meaning Ctrl+F3 should use that mode (it's occasionally useful). This change should be altered by only clearing Word flags if Regexp was present; if it wasn't, leave Word flags as they were.

cshnik commented 1 year ago

Fixed.