aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2023-11-06 08:58:31 +1100
committerNeil <nyamatongwe@gmail.com>2023-11-06 08:58:31 +1100
commitc9668d46c7209e8f1f86a109e9c41aac07232492 (patch)
tree13dd7667afa0ceae52097cafcd8f089cc13c269d /src/Editor.cxx
parent026058ceca31c336a6d76f248ae2510fe1b1247c (diff)
downloadscintilla-mirror-c9668d46c7209e8f1f86a109e9c41aac07232492.tar.gz
Ctrl-click on a selection deselects it in multiple selection mode.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 3018cc0bd..3421dc72d 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -4789,8 +4789,22 @@ void Editor::ButtonDownWithModifiers(Point pt, unsigned int curTime, KeyMod modi
hotSpotClickPos = newCharPos.Position();
}
if (!shift) {
- if (PointInSelection(pt) && !SelectionEmpty()) {
- inDragDrop = DragDrop::initial;
+ const ptrdiff_t selectionPart = SelectionFromPoint(pt);
+ if (selectionPart >= 0) {
+ if (multipleSelection && ctrl) {
+ // Deselect
+ if (sel.Count() > 1) {
+ DropSelection(selectionPart);
+ // Completed: don't want any more processing of this click
+ return;
+ } else {
+ // Switch to just the click position
+ SetSelection(newPos, newPos);
+ }
+ }
+ if (!sel.Range(selectionPart).Empty()) {
+ inDragDrop = DragDrop::initial;
+ }
}
}
ChangeMouseCapture(true);