Hi Neil,
On Sun, 12 Nov 2017, Neil Hodgson wrote:
> Mitchell:
>
>> Okay, please see the new patch, which is against 4.0.2. After some further thought, I tweaked the behavior such that `SCI_GETSELECTIONMODE` will return `SCI_SEL_STREAMDEFAULT` or `SCI_SEL_RECTANGLEDEFAULT` if `SCI_SETSELECTIONMODE` was not previously set. Otherwise, when `sel.MoveExtends()` is active, `SCI_GETSELECTIONMODE` will return whatever was passed to `SCI_SETSELECTIONMODE`. I think this behavior makes more sense, and is documented in the patch.
>
> This appears to be less compatible with current applications. Performing an internet search for SCI_GETSELECTIONMODE shows code like:
>
> if ((*_ppEditView)->execute(SCI_GETSELECTIONMODE) == SC_SEL_RECTANGLE)
>
> The above code will not work when the user performs a rectangular selection by holding down the Alt key. Using move-selects is less common than Alt key rectangular selection.
Yes, but they should be using `SCI_SELECTIONISRECTANGLE` instead.
> Adding new return values is an incompatibility but I thought it would be a minor issue with the previous proposal.
Yes, but I figured since 4.x is a pretty big break from 3.x, why not make the change now? Also, it seems to me that `SCI_SETSELECTIONMODE` and `SCI_GETSELECTIONMODE` were designed more for `sel.MoveExtends()` than for generic selection state queries. Or was `sel.MoveExtends()` added as an after effect?
> Perhaps this would be better as an additional API SCI_GETMOVESELECTS?
>
> Extra benefit if there can be a SCI_SETMOVESELECTS so an app can save and restore the state more accurately. Setting would have to be performed in the order: SELECTIONMODE, MOVESELECTS as SCI_SETMOVESELECTS changes the move-selects state.
I don't think either is necessary based on my rationale above.
Cheers,
Mitchell