Handle double and triple click on lines

This commit is contained in:
Nathan Sobo
2017-03-09 19:31:29 -07:00
committed by Antonio Scandurra
parent fab5a93254
commit 2996500d90
2 changed files with 33 additions and 4 deletions

View File

@@ -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
}
}