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:
Kevin Sawicki
2013-02-19 21:55:23 -08:00
parent 6047590544
commit 9c372fa9bf
2 changed files with 12 additions and 3 deletions

View File

@@ -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()

View File

@@ -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