diff --git a/src/atom-environment.coffee b/src/atom-environment.coffee index 14dfdc77a..8b2fbf563 100644 --- a/src/atom-environment.coffee +++ b/src/atom-environment.coffee @@ -189,13 +189,15 @@ class AtomEnvironment extends Model @commandInstaller = new CommandInstaller(@getVersion(), @applicationDelegate) + @textEditors = new TextEditorRegistry({@config}) + @workspace = new Workspace({ @config, @project, packageManager: @packages, grammarRegistry: @grammars, deserializerManager: @deserializers, - notificationManager: @notifications, @applicationDelegate, @clipboard, viewRegistry: @views, assert: @assert.bind(this) + notificationManager: @notifications, @applicationDelegate, @clipboard, viewRegistry: @views, assert: @assert.bind(this), + textEditorRegistry: @textEditors, }) @themes.workspace = @workspace - @textEditors = new TextEditorRegistry({@config}) @autoUpdater = new AutoUpdateManager({@applicationDelegate}) @config.load() diff --git a/src/workspace.coffee b/src/workspace.coffee index bde2a62d3..2cac6e4fd 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -31,7 +31,7 @@ class Workspace extends Model { @packageManager, @config, @project, @grammarRegistry, @notificationManager, @clipboard, @viewRegistry, @grammarRegistry, @applicationDelegate, @assert, - @deserializerManager + @deserializerManager, @textEditorRegistry } = params @emitter = new Emitter @@ -575,7 +575,9 @@ class Workspace extends Model params = Object.assign({ @config, @clipboard, @grammarRegistry, @assert }, params) - new TextEditor(params) + editor = new TextEditor(params) + @textEditorRegistry.maintainConfig(editor) + editor # Public: Asynchronously reopens the last-closed item's URI if it hasn't already been # reopened.