When decorating a MarkerLayer, get its corresponding DisplayMarkerLayer

This fixes 'folded' line number decorations.
This commit is contained in:
Nathan Sobo 2017-03-14 15:48:04 -06:00 committed by Antonio Scandurra
parent a2f75c8337
commit 68659d9698
2 changed files with 8 additions and 0 deletions

View File

@ -224,6 +224,13 @@ describe('TextEditorComponent', () => {
expect(scroller.clientWidth).toBe(scroller.scrollWidth)
})
it('decorates the line numbers of folded lines', async () => {
const {component, element, editor} = buildComponent()
editor.foldBufferRow(1)
await component.getNextUpdatePromise()
expect(lineNumberNodeForScreenRow(component, 1).classList.contains('folded')).toBe(true)
})
describe('focus', () => {
it('focuses the hidden input element and adds the is-focused class when focused', async () => {
assertDocumentFocused()

View File

@ -200,6 +200,7 @@ class DecorationManager {
if (markerLayer.isDestroyed()) {
throw new Error('Cannot decorate a destroyed marker layer')
}
markerLayer = this.displayLayer.getMarkerLayer(markerLayer.id)
const decoration = new LayerDecoration(markerLayer, this, decorationParams)
let layerDecorations = this.layerDecorationsByMarkerLayer.get(markerLayer)
if (layerDecorations == null) {