mirror of
https://github.com/atom/atom.git
synced 2026-02-16 01:25:13 -05:00
Introduce TextEditorRegistry::build
This way, we can construct text editors with the right parameters from the start
This commit is contained in:
@@ -561,10 +561,7 @@ class Workspace extends Model
|
||||
throw error
|
||||
|
||||
@project.bufferForPath(filePath, options).then (buffer) =>
|
||||
new TextEditor(Object.assign(
|
||||
{@clipboard, @assert, buffer, largeFileMode},
|
||||
options
|
||||
))
|
||||
@textEditorRegistry.build(Object.assign({buffer, largeFileMode}, options))
|
||||
|
||||
handleGrammarUsed: (grammar) ->
|
||||
return unless grammar?
|
||||
@@ -581,7 +578,7 @@ class Workspace extends Model
|
||||
#
|
||||
# Returns a {TextEditor}.
|
||||
buildTextEditor: (params) ->
|
||||
editor = new TextEditor(Object.assign({@clipboard, @assert}, params))
|
||||
editor = @textEditorRegistry.build(params)
|
||||
subscriptions = new CompositeDisposable(
|
||||
@textEditorRegistry.maintainGrammar(editor)
|
||||
@textEditorRegistry.maintainConfig(editor),
|
||||
|
||||
Reference in New Issue
Block a user