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

Selection start changes if replacing leading substring #468

Closed ProgerXP closed 10 months ago

ProgerXP commented 1 year ago

Normally, Replace retains cursor and selection positions but not when the string was found in the beginning of the selection: [abcabc] - Replace from a to z, get z[bczbc] rather than [zbczbc].

cshnik commented 1 year ago

Created bug for Scintilla: #2393 Incorrect selection change when processing SCI_REPLACETARGET message

cshnik commented 10 months ago

Fixed.

Regarding the comments from Scintilla's team specified selection change is intended and no proper fix is currently available:

I am rejecting this as a bug report since the behaviour is intentional. It would be possible to offer alternative options but they would have to be defined well. In particular, the behaviour with multiple selections that touch should be specified.

Since Notepad2e already use patched version of Scintilla we decided to implement "dirty" fix which will address this issue and does not break other functionality (Scintilla's multiple selections are not utilized by N2e).