Merge branch 'master' into dw-nightly-releases

This commit is contained in:
David Wilson
2018-07-06 16:06:24 -07:00
9 changed files with 99 additions and 15 deletions

View File

@@ -326,7 +326,9 @@ class Cursor extends Model {
// Public: Moves the cursor to the bottom of the buffer.
moveToBottom () {
const column = this.goalColumn
this.setBufferPosition(this.editor.getEofBufferPosition())
this.goalColumn = column
}
// Public: Moves the cursor to the beginning of the line.
@@ -711,6 +713,7 @@ class Cursor extends Model {
changePosition (options, fn) {
this.clearSelection({autoscroll: false})
fn()
this.goalColumn = null
const autoscroll = (options && options.autoscroll != null)
? options.autoscroll
: this.isLastCursor()

View File

@@ -304,6 +304,7 @@ class TreeSitterLanguageMode {
foldEnd = new Point(foldEndNode.startPosition.row - 1, Infinity)
} else {
foldEnd = foldEndNode.startPosition
if (!pointIsGreater(foldEnd, foldStart)) continue
}
} else {
const {endPosition} = node
@@ -561,6 +562,10 @@ class TreeSitterHighlightIterator {
}
}
function pointIsGreater (left, right) {
return left.row > right.row || left.row === right.row && left.column > right.column
}
function last (array) {
return array[array.length - 1]
}

View File

@@ -1268,7 +1268,8 @@ module.exports = class Workspace extends Model {
handleGrammarUsed (grammar) {
if (grammar == null) { return }
return this.packageManager.triggerActivationHook(`${grammar.packageName}:grammar-used`)
this.packageManager.triggerActivationHook(`${grammar.scopeName}:root-scope-used`)
this.packageManager.triggerActivationHook(`${grammar.packageName}:grammar-used`)
}
// Public: Returns a {Boolean} that is `true` if `object` is a `TextEditor`.