mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Remove showInvisibles constructor param on Editor
And remove `showInvisibles` state from the `RootView` now that it's managed via `config`.
This commit is contained in:
@@ -50,12 +50,12 @@ class Editor extends View
|
||||
|
||||
@deserialize: (state, rootView) ->
|
||||
editSessions = state.editSessions.map (state) -> EditSession.deserialize(state, rootView.project)
|
||||
editor = new Editor(editSession: editSessions[state.activeEditSessionIndex], mini: state.mini, showInvisibles: rootView.showInvisibles)
|
||||
editor = new Editor(editSession: editSessions[state.activeEditSessionIndex], mini: state.mini)
|
||||
editor.editSessions = editSessions
|
||||
editor.isFocused = state.isFocused
|
||||
editor
|
||||
|
||||
initialize: ({editSession, @mini, @showInvisibles} = {}) ->
|
||||
initialize: ({editSession, @mini} = {}) ->
|
||||
requireStylesheet 'editor.css'
|
||||
|
||||
@id = Editor.idCounter++
|
||||
@@ -622,7 +622,7 @@ class Editor extends View
|
||||
@requestDisplayUpdate()
|
||||
|
||||
newSplitEditor: ->
|
||||
new Editor { editSession: @activeEditSession.copy(), @showInvisibles }
|
||||
new Editor { editSession: @activeEditSession.copy() }
|
||||
|
||||
splitLeft: ->
|
||||
@pane()?.splitLeft(@newSplitEditor()).wrappedView
|
||||
|
||||
@@ -30,7 +30,6 @@ class RootView extends View
|
||||
extensions: null
|
||||
extensionStates: null
|
||||
fontSize: 20
|
||||
showInvisibles: false
|
||||
invisibles: null
|
||||
title: null
|
||||
|
||||
@@ -88,7 +87,9 @@ class RootView extends View
|
||||
@command 'window:decrease-font-size', => @setFontSize(@getFontSize() - 1)
|
||||
@command 'window:focus-next-pane', => @focusNextPane()
|
||||
@command 'window:save-all', => @saveAll()
|
||||
@command 'window:toggle-invisibles', => @setShowInvisibles(not @showInvisibles)
|
||||
@command 'window:toggle-invisibles', =>
|
||||
config.editor.showInvisibles = not config.editor.showInvisibles
|
||||
config.update()
|
||||
@command 'window:toggle-ignored-files', => @toggleIgnoredFiles()
|
||||
|
||||
afterAttach: (onDom) ->
|
||||
@@ -130,7 +131,7 @@ class RootView extends View
|
||||
|
||||
unless editSession = @openInExistingEditor(path, allowActiveEditorChange, changeFocus)
|
||||
editSession = @project.buildEditSessionForPath(path)
|
||||
editor = new Editor({editSession, @showInvisibles})
|
||||
editor = new Editor({editSession})
|
||||
pane = new Pane(editor)
|
||||
@panes.append(pane)
|
||||
if changeFocus
|
||||
@@ -197,11 +198,6 @@ class RootView extends View
|
||||
updateWindowTitle: ->
|
||||
document.title = @title
|
||||
|
||||
setShowInvisibles: (showInvisibles) ->
|
||||
return if @showInvisibles == showInvisibles
|
||||
@showInvisibles = showInvisibles
|
||||
editor.setShowInvisibles(@showInvisibles) for editor in @getEditors()
|
||||
|
||||
toggleIgnoredFiles: ->
|
||||
@project.toggleIgnoredFiles()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user