This change has introduced random behavior when clicking multiple times while holding CTRL key. Transition from line selection to character selection doesn't work properly anymore.
You also forgot to reference this bug in Hg history when you made the change.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The update has removed the ability to use ctrl+triple click to select multiple lines, which was possible using the original modification. While ctrl+triple click was not part of the original request, it is actually a useful addition and can even be a nice alternative to the feature request #3520035.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Unfortunately, the one line change that was used to implement this feature is not enough and must be reverted until a proper implementation is made. With this change it is possible to make multiple selections that can overlap, but Scintilla can't cope with situations when a single character belongs to multiple selections. This can lead to unpredictable behavior when you start typing to overwrite such selections (the same character will be added multiple times, instead of only once).
Selection simplification is handled in other circumstances by the TrimSelection method which is invoked by tentative selection handling. This isn't tentative but could still use TrimSelection or AddSelection.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It isn't that simple, as you have to adjust selections on the fly when you're in drag selection mode. Handling this properly would require modifications in both ButtonMove and ButtonUp methods. Not to mention possible corner cases that can arise during implementation. Good luck.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The following patch does this but I haven't tested it thoroughly:
@@ -6233,7 +6233,8 @@
if (((curTime - lastClickTime) < Platform::DoubleClickTime()) && Close(pt, lastClick)) {
//Platform::DebugPrintf("Double click %d %d = %d\n", curTime, lastClickTime, curTime - lastClickTime);
SetMouseCapture(true);
- SetEmptySelection(newPos.Position());
+ if (!ctrl)
+ SetEmptySelection(newPos.Position());
bool doubleClick = false;
// Stop mouse button bounce changing selection type
if (!Platform::MouseButtonBounce() || curTime != lastClickTime) {
Committed change.
This change has introduced random behavior when clicking multiple times while holding CTRL key. Transition from line selection to character selection doesn't work properly anymore.
You also forgot to reference this bug in Hg history when you made the change.
Updated so transition from line selection back to character selection should work OK.
The update has removed the ability to use ctrl+triple click to select multiple lines, which was possible using the original modification. While ctrl+triple click was not part of the original request, it is actually a useful addition and can even be a nice alternative to the feature request #3520035.
I forgot to mention that you should also add a check for multipleSelection to the if condition, just to be entirely correct and avoid surprises:
if (!ctrl || !multipleSelection || (selectionType != selChar && selectionType != selWord))
SetEmptySelection(newPos.Position());
Committed.
Unfortunately, the one line change that was used to implement this feature is not enough and must be reverted until a proper implementation is made. With this change it is possible to make multiple selections that can overlap, but Scintilla can't cope with situations when a single character belongs to multiple selections. This can lead to unpredictable behavior when you start typing to overwrite such selections (the same character will be added multiple times, instead of only once).
More details about the problem can be found in Neil's comment on bug #294563: https://sourceforge.net/tracker/?func=detail&aid=2945631&group_id=2439&atid=102439
Selection simplification is handled in other circumstances by the TrimSelection method which is invoked by tentative selection handling. This isn't tentative but could still use TrimSelection or AddSelection.
It isn't that simple, as you have to adjust selections on the fly when you're in drag selection mode. Handling this properly would require modifications in both ButtonMove and ButtonUp methods. Not to mention possible corner cases that can arise during implementation. Good luck.
Committed changes to trim selection when performing word or line selection.