Don't need to pass view registry through anymore.

This commit is contained in:
joshaber
2016-04-25 16:26:28 -04:00
parent 32a53e392c
commit 8d7f1b8fba
2 changed files with 3 additions and 6 deletions

View File

@@ -80,7 +80,6 @@ class TextEditor extends Model
state.selectionsMarkerLayer = displayBuffer.getMarkerLayer(state.selectionsMarkerLayerId)
state.config = atomEnvironment.config
state.clipboard = atomEnvironment.clipboard
state.viewRegistry = atomEnvironment.views
state.grammarRegistry = atomEnvironment.grammars
state.project = atomEnvironment.project
state.assert = atomEnvironment.assert.bind(atomEnvironment)
@@ -97,14 +96,12 @@ class TextEditor extends Model
{
@softTabs, @firstVisibleScreenRow, @firstVisibleScreenColumn, initialLine, initialColumn, tabLength,
softWrapped, @displayBuffer, @selectionsMarkerLayer, buffer, suppressCursorCreation,
@mini, @placeholderText, lineNumberGutterVisible, largeFileMode, @config,
@clipboard, @viewRegistry, @grammarRegistry,
@mini, @placeholderText, lineNumberGutterVisible, largeFileMode, @config, @clipboard, @grammarRegistry,
@project, @assert, @applicationDelegate, grammar, showInvisibles, @autoHeight, @scrollPastEnd
} = params
throw new Error("Must pass a config parameter when constructing TextEditors") unless @config?
throw new Error("Must pass a clipboard parameter when constructing TextEditors") unless @clipboard?
throw new Error("Must pass a viewRegistry parameter when constructing TextEditors") unless @viewRegistry?
throw new Error("Must pass a grammarRegistry parameter when constructing TextEditors") unless @grammarRegistry?
throw new Error("Must pass a project parameter when constructing TextEditors") unless @project?
throw new Error("Must pass an assert parameter when constructing TextEditors") unless @assert?
@@ -521,7 +518,7 @@ class TextEditor extends Model
@buffer, displayBuffer, selectionsMarkerLayer, @tabLength, softTabs,
suppressCursorCreation: true, @config,
@firstVisibleScreenRow, @firstVisibleScreenColumn,
@clipboard, @viewRegistry, @grammarRegistry, @project, @assert, @applicationDelegate
@clipboard, @grammarRegistry, @project, @assert, @applicationDelegate
})
newEditor

View File

@@ -570,7 +570,7 @@ class Workspace extends Model
# Returns a {TextEditor}.
buildTextEditor: (params) ->
params = _.extend({
@config, @clipboard, @viewRegistry, @grammarRegistry,
@config, @packageManager, @clipboard, @grammarRegistry,
@project, @assert, @applicationDelegate
}, params)
new TextEditor(params)