Always move the cursor on middle-click

This commit is contained in:
Wliu
2017-12-05 23:38:21 +01:00
parent 69214dc26a
commit db392502e4
2 changed files with 126 additions and 59 deletions

View File

@@ -1759,9 +1759,10 @@ class TextEditorComponent {
const screenPosition = this.screenPositionForMouseEvent(event)
if (button !== 0 || (platform === 'darwin' && ctrlKey)) {
// Set cursor position only if there is one cursor with no selection
// Always set cursor position on middle-click
// Only set cursor position on right-click if there is one cursor with no selection
const ranges = model.getSelectedBufferRanges()
if (ranges.length === 1 && ranges[0].isEmpty()) {
if (button === 1 || (ranges.length === 1 && ranges[0].isEmpty())) {
model.setCursorScreenPosition(screenPosition, {autoscroll: false})
}