mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Load text package before deserializing path state
This is required for any editors that are deserialized since a fallback grammar is always needed.
This commit is contained in:
@@ -39,12 +39,19 @@ _.extend atom,
|
||||
packageStates[pack.name] = @atomPackageStates[pack.name]
|
||||
packageStates
|
||||
|
||||
loadTextPackage: ->
|
||||
textPackagePath = _.find @getPackagePaths(), (path) -> fs.base(path) is 'text.tmbundle'
|
||||
pack = Package.build(textPackagePath)
|
||||
@loadedPackages.push(pack)
|
||||
pack.load()
|
||||
|
||||
loadPackages: ->
|
||||
textMatePackages = []
|
||||
for path in @getPackagePaths()
|
||||
paths = @getPackagePaths().filter (path) -> fs.base(path) isnt 'text.tmbundle'
|
||||
for path in paths
|
||||
pack = Package.build(path)
|
||||
@loadedPackages.push(pack)
|
||||
if pack instanceof TextMatePackage and fs.base(pack.path) isnt 'text.tmbundle'
|
||||
if pack instanceof TextMatePackage
|
||||
textMatePackages.push(pack)
|
||||
else
|
||||
pack.load()
|
||||
|
||||
@@ -44,6 +44,7 @@ windowAdditions =
|
||||
startApplication: ->
|
||||
handleWindowEvents()
|
||||
config.load()
|
||||
atom.loadTextPackage()
|
||||
buildProjectAndRootView()
|
||||
keymap.loadBundledKeymaps()
|
||||
atom.loadThemes()
|
||||
@@ -59,7 +60,8 @@ windowAdditions =
|
||||
RootView = require 'root-view'
|
||||
Project = require 'project'
|
||||
|
||||
if windowState = atom.getRootViewStateForPath(atom.getPathToOpen()) and windowState?.project?
|
||||
windowState = atom.getRootViewStateForPath(atom.getPathToOpen())
|
||||
if windowState?.project?
|
||||
window.project = deserialize(windowState.project)
|
||||
window.rootView = deserialize(windowState.rootView)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user