Make first-mate scope ids always larger than built-in ones

This commit is contained in:
Antonio Scandurra
2017-05-04 17:31:27 +02:00
parent c2b854123b
commit ccc35b5141
2 changed files with 3 additions and 3 deletions

View File

@@ -2,10 +2,10 @@ module.exports = {
fromFirstMateScopeId (firstMateScopeId) {
let atomScopeId = -firstMateScopeId
if ((atomScopeId & 1) === 0) atomScopeId--
return atomScopeId
return atomScopeId + 256
},
toFirstMateScopeId (atomScopeId) {
return -atomScopeId
return -(atomScopeId - 256)
}
}

View File

@@ -214,7 +214,7 @@ class TextEditor extends Model
@disposables.add new Disposable =>
cancelIdleCallback(@backgroundWorkHandle) if @backgroundWorkHandle?
@displayLayer.addTextDecorationLayer(@tokenizedBuffer)
@displayLayer.setTextDecorationLayer(@tokenizedBuffer)
@defaultMarkerLayer = @displayLayer.addMarkerLayer()
@disposables.add(@defaultMarkerLayer.onDidDestroy =>
@assert(false, "defaultMarkerLayer destroyed at an unexpected time")