mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Show/hide line decorations when TextEditor::mini changes
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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: ->
|
||||
|
||||
Reference in New Issue
Block a user