mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Always move the cursor on middle-click
This commit is contained in:
@@ -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})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user