Destroy folds on fold marker click

This commit is contained in:
Nathan Sobo
2017-03-14 16:02:20 -06:00
committed by Antonio Scandurra
parent 68659d9698
commit c2206b88da
2 changed files with 20 additions and 1 deletions

View File

@@ -761,13 +761,20 @@ class TextEditorComponent {
didMouseDownOnContent (event) {
const {model} = this.props
const {button, detail, ctrlKey, shiftKey, metaKey} = event
const {target, button, detail, ctrlKey, shiftKey, metaKey} = event
// Only handle mousedown events for left mouse button (or the middle mouse
// button on Linux where it pastes the selection clipboard).
if (!(button === 0 || (this.getPlatform() === 'linux' && button === 1))) return
const screenPosition = this.screenPositionForMouseEvent(event)
if (target.matches('.fold-marker')) {
const bufferPosition = model.bufferPositionForScreenPosition(screenPosition)
model.destroyFoldsIntersectingBufferRange(Range(bufferPosition, bufferPosition))
return
}
const addOrRemoveSelection = metaKey || (ctrlKey && this.getPlatform() !== 'darwin')
switch (detail) {