mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
🐛 Ignore setting dimensions for destroyed decorations
This commit is contained in:
@@ -2375,6 +2375,15 @@ describe "TextEditorPresenter", ->
|
||||
isVisible: true
|
||||
}
|
||||
|
||||
it "doesn't throw an error when setting the dimensions for a destroyed decoration", ->
|
||||
blockDecoration = addBlockDecorationForScreenRow(0)
|
||||
presenter = buildPresenter(explicitHeight: 30, lineHeight: 10, tileSize: 2, scrollTop: 0)
|
||||
blockDecoration.destroy()
|
||||
|
||||
presenter.setBlockDecorationDimensions(blockDecoration, 30, 30)
|
||||
|
||||
expect(getState(presenter).content.blockDecorations).toEqual({})
|
||||
|
||||
describe ".overlays", ->
|
||||
[item] = []
|
||||
stateForOverlay = (presenter, decoration) ->
|
||||
|
||||
@@ -1270,6 +1270,8 @@ class TextEditorPresenter
|
||||
@emitDidUpdateState()
|
||||
|
||||
setBlockDecorationDimensions: (decoration, width, height) ->
|
||||
return unless @observedBlockDecorations.has(decoration)
|
||||
|
||||
@lineTopIndex.resizeBlock(decoration.getId(), height)
|
||||
|
||||
@invalidatedDimensionsByBlockDecoration.delete(decoration)
|
||||
|
||||
Reference in New Issue
Block a user