Don’t apply line decorations to mini editors

Esse commit está contido em:
Nathan Sobo
2015-01-21 16:02:21 -07:00
commit 9a496e62cb
2 arquivos alterados com 10 adições e 0 exclusões
+8
Ver Arquivo
@@ -349,3 +349,11 @@ describe "TextEditorPresenter", ->
expect(lineStateForScreenRow(presenter, 4).decorationClasses).toEqual ['a']
expect(lineStateForScreenRow(presenter, 5).decorationClasses).toEqual ['a']
expect(lineStateForScreenRow(presenter, 6).decorationClasses).toBeNull()
it "does not apply line decorations to mini editors", ->
editor.setMini(true)
presenter = new TextEditorPresenter(model: editor, clientHeight: 10, scrollTop: 0, lineHeight: 10, lineOverdrawMargin: 0)
marker = editor.markBufferRange([[0, 0], [0, 0]])
decoration = editor.decorateMarker(marker, type: 'line', class: 'a')
expect(lineStateForScreenRow(presenter, 0).decorationClasses).toBeNull()
+2
Ver Arquivo
@@ -98,6 +98,8 @@ class TextEditorPresenter
Math.max(contentWidth, @getClientWidth())
lineDecorationClassesForRow: (row) ->
return null if @model.isMini()
decorationClasses = null
for markerId, decorations of @model.decorationsForScreenRowRange(row, row) when @model.getMarker(markerId).isValid()
for decoration in decorations when decoration.isType('line')