mirror of
https://github.com/atom/atom.git
synced 2026-02-14 00:25:08 -05:00
Don't need to pass Project around anymore.
This commit is contained in:
@@ -81,7 +81,6 @@ class TextEditor extends Model
|
||||
state.config = atomEnvironment.config
|
||||
state.clipboard = atomEnvironment.clipboard
|
||||
state.grammarRegistry = atomEnvironment.grammars
|
||||
state.project = atomEnvironment.project
|
||||
state.assert = atomEnvironment.assert.bind(atomEnvironment)
|
||||
state.applicationDelegate = atomEnvironment.applicationDelegate
|
||||
editor = new this(state)
|
||||
@@ -97,13 +96,12 @@ class TextEditor extends Model
|
||||
@softTabs, @firstVisibleScreenRow, @firstVisibleScreenColumn, initialLine, initialColumn, tabLength,
|
||||
softWrapped, @displayBuffer, @selectionsMarkerLayer, buffer, suppressCursorCreation,
|
||||
@mini, @placeholderText, lineNumberGutterVisible, largeFileMode, @config, @clipboard, @grammarRegistry,
|
||||
@project, @assert, @applicationDelegate, grammar, showInvisibles, @autoHeight, @scrollPastEnd
|
||||
@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 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?
|
||||
|
||||
@firstVisibleScreenRow ?= 0
|
||||
@@ -516,7 +514,7 @@ class TextEditor extends Model
|
||||
@buffer, displayBuffer, selectionsMarkerLayer, @tabLength, softTabs,
|
||||
suppressCursorCreation: true, @config,
|
||||
@firstVisibleScreenRow, @firstVisibleScreenColumn,
|
||||
@clipboard, @grammarRegistry, @project, @assert, @applicationDelegate
|
||||
@clipboard, @grammarRegistry, @assert, @applicationDelegate
|
||||
})
|
||||
newEditor
|
||||
|
||||
|
||||
Reference in New Issue
Block a user