s/ignoreInvisibles/showInvisibles

This commit is contained in:
joshaber
2016-03-03 09:59:45 -05:00
parent b26b6ced0a
commit db20cecfc0
2 changed files with 6 additions and 4 deletions

View File

@@ -5829,11 +5829,11 @@ describe "TextEditor", ->
rangeIsReversed: false
}
describe "when the editor is constructed with the ignoreInvisibles option set to true", ->
describe "when the editor is constructed with the showInvisibles option set to false", ->
beforeEach ->
atom.workspace.destroyActivePane()
waitsForPromise ->
atom.workspace.open('sample.js', ignoreInvisibles: true).then (o) -> editor = o
atom.workspace.open('sample.js', showInvisibles: false).then (o) -> editor = o
it "ignores invisibles even if editor.showInvisibles is true", ->
atom.config.set('editor.showInvisibles', true)

View File

@@ -100,7 +100,7 @@ class TextEditor extends Model
softWrapped, @displayBuffer, @selectionsMarkerLayer, buffer, suppressCursorCreation,
@mini, @placeholderText, lineNumberGutterVisible, largeFileMode, @config,
@notificationManager, @packageManager, @clipboard, @viewRegistry, @grammarRegistry,
@project, @assert, @applicationDelegate, grammarName, ignoreInvisibles, @autoHeight, @ignoreScrollPastEnd
@project, @assert, @applicationDelegate, grammarName, showInvisibles, @autoHeight, @ignoreScrollPastEnd
} = params
throw new Error("Must pass a config parameter when constructing TextEditors") unless @config?
@@ -123,9 +123,11 @@ class TextEditor extends Model
@ignoreScrollPastEnd ?= false
@hasTerminatedPendingState = false
showInvisibles ?= true
buffer ?= new TextBuffer
@displayBuffer ?= new DisplayBuffer({
buffer, tabLength, softWrapped, ignoreInvisibles: @mini or ignoreInvisibles, largeFileMode,
buffer, tabLength, softWrapped, ignoreInvisibles: @mini or !showInvisibles, largeFileMode,
@config, @assert, @grammarRegistry, @packageManager
})
@buffer = @displayBuffer.buffer