diff options
-rw-r--r-- | doc/ScintillaHistory.html | 3 | ||||
-rw-r--r-- | src/Editor.cxx | 18 |
2 files changed, 19 insertions, 2 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 2e26d8900..b37d6bbf0 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -591,6 +591,9 @@ Released 18 November 2023. </li> <li> + Ctrl-click on a selection deselects it in multiple selection mode. + </li> + <li> Add SCI_SELECTIONFROMPOINT for modifying multiple selections. </li> <li> 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); |