From c9668d46c7209e8f1f86a109e9c41aac07232492 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 6 Nov 2023 08:58:31 +1100 Subject: Ctrl-click on a selection deselects it in multiple selection mode. --- src/Editor.cxx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.3