mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Merge branch 'master' into dw-nightly-releases
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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]
|
||||
}
|
||||
|
||||
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user