mirror of
https://github.com/atom/atom.git
synced 2026-02-10 22:55:09 -05:00
Handle double and triple click on lines
This commit is contained in:
committed by
Antonio Scandurra
parent
fab5a93254
commit
2996500d90
@@ -736,10 +736,19 @@ class TextEditorComponent {
|
||||
}
|
||||
|
||||
didMouseDownOnLines (event) {
|
||||
const {model} = this.props
|
||||
const screenPosition = this.screenPositionForMouseEvent(event)
|
||||
|
||||
if (event.detail === 1) {
|
||||
this.props.model.setCursorScreenPosition(screenPosition)
|
||||
switch (event.detail) {
|
||||
case 1:
|
||||
model.setCursorScreenPosition(screenPosition)
|
||||
break
|
||||
case 2:
|
||||
model.getLastSelection().selectWord({autoscroll: false})
|
||||
break
|
||||
case 3:
|
||||
model.getLastSelection().selectLine(null, {autoscroll: false})
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user