mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Don't show indent guides for mini editors
This commit is contained in:
@@ -5967,6 +5967,20 @@ describe "TextEditor", ->
|
||||
atom.config.set('editor.showInvisibles', true)
|
||||
expect(editor.lineTextForScreenRow(0).indexOf(atom.config.get('editor.invisibles.eol'))).toBe(-1)
|
||||
|
||||
describe "indent guides", ->
|
||||
it "shows indent guides when `editor.showIndentGuide` is set to true and the editor is not mini", ->
|
||||
editor.setText(" foo")
|
||||
atom.config.set('editor.tabLength', 2)
|
||||
|
||||
atom.config.set('editor.showIndentGuide', false)
|
||||
expect(editor.tokensForScreenRow(0)).toEqual ['source.js', 'leading-whitespace']
|
||||
|
||||
atom.config.set('editor.showIndentGuide', true)
|
||||
expect(editor.tokensForScreenRow(0)).toEqual ['source.js', 'leading-whitespace indent-guide']
|
||||
|
||||
editor.setMini(true)
|
||||
expect(editor.tokensForScreenRow(0)).toEqual ['source.js', 'leading-whitespace']
|
||||
|
||||
describe "when the editor is constructed with the grammar option set", ->
|
||||
beforeEach ->
|
||||
atom.workspace.destroyActivePane()
|
||||
|
||||
@@ -257,7 +257,7 @@ class TextEditor extends Model
|
||||
@displayLayer.reset({
|
||||
invisibles: @getInvisibles(),
|
||||
softWrapColumn: @getSoftWrapColumn(),
|
||||
showIndentGuides: @config.get('editor.showIndentGuide', scope: @getRootScopeDescriptor()),
|
||||
showIndentGuides: not @isMini() and @config.get('editor.showIndentGuide', scope: @getRootScopeDescriptor()),
|
||||
atomicSoftTabs: @config.get('editor.atomicSoftTabs', scope: @getRootScopeDescriptor()),
|
||||
tabLength: @getTabLength(),
|
||||
ratioForCharacter: @ratioForCharacter.bind(this),
|
||||
@@ -589,7 +589,8 @@ class TextEditor extends Model
|
||||
setMini: (mini) ->
|
||||
if mini isnt @mini
|
||||
@mini = mini
|
||||
@setIgnoreInvisibles(@mini)
|
||||
@ignoreInvisibles = @mini
|
||||
@resetDisplayLayer()
|
||||
@emitter.emit 'did-change-mini', @mini
|
||||
@mini
|
||||
|
||||
|
||||
Reference in New Issue
Block a user