Show/hide line decorations when TextEditor::mini changes

This commit is contained in:
Nathan Sobo
2015-01-21 16:05:25 -07:00
parent 9a496e62cb
commit fe5ee524a8
2 changed files with 7 additions and 1 deletions

View File

@@ -355,5 +355,10 @@ describe "TextEditorPresenter", ->
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()
editor.setMini(false)
expect(lineStateForScreenRow(presenter, 0).decorationClasses).toEqual ['cursor-line', 'a']
editor.setMini(true)
expect(lineStateForScreenRow(presenter, 0).decorationClasses).toBeNull()

View File

@@ -18,6 +18,7 @@ class TextEditorPresenter
@disposables.add @model.onDidChangeSoftWrapped(@updateState.bind(this))
@disposables.add @model.onDidChangeGrammar(@updateContentState.bind(this))
@disposables.add @model.onDidAddDecoration(@didAddDecoration.bind(this))
@disposables.add @model.onDidChangeMini(@updateLinesState.bind(this))
@observeDecoration(decoration) for decoration in @model.getLineDecorations()
observeConfig: ->