diff --git a/src/text-editor-component.js b/src/text-editor-component.js index da6ec452d..a43616122 100644 --- a/src/text-editor-component.js +++ b/src/text-editor-component.js @@ -1758,11 +1758,12 @@ class TextEditorComponent { const screenPosition = this.screenPositionForMouseEvent(event) - // All clicks should set the cursor position, but only left-clicks should - // have additional logic. - // On macOS, ctrl-click brings up the context menu so also handle that case. if (button !== 0 || (platform === 'darwin' && ctrlKey)) { - model.setCursorScreenPosition(screenPosition, {autoscroll: false}) + // Set cursor position only if there is one cursor with no selection + const ranges = model.getSelectedBufferRanges() + if (ranges.length === 1 && ranges[0].isEmpty()) { + model.setCursorScreenPosition(screenPosition, {autoscroll: false}) + } // On Linux, pasting happens on middle click. A textInput event with the // contents of the selection clipboard will be dispatched by the browser