Don’t apply line decorations to mini editors
Esse commit está contido em:
@@ -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()
|
||||
|
||||
@@ -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')
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário