mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-06 23:26:25 +03:00
Move Syntax global to Atom class
This commit is contained in:
parent
5c4a8f55c8
commit
e2d727f838
@ -16,6 +16,7 @@ PackageManager = require './package-manager'
|
||||
Pasteboard = require './pasteboard'
|
||||
Project = require './project'
|
||||
RootView = require './root-view'
|
||||
Syntax = require './syntax'
|
||||
Subscriber = require './subscriber'
|
||||
ThemeManager = require './theme-manager'
|
||||
ContextMenuManager = require './context-menu-manager'
|
||||
@ -24,12 +25,14 @@ ContextMenuManager = require './context-menu-manager'
|
||||
module.exports =
|
||||
class Atom extends Subscriber
|
||||
constructor: ->
|
||||
@rootViewParentSelector = 'body'
|
||||
@packages = new PackageManager()
|
||||
@themes = new ThemeManager()
|
||||
@contextMenu = new ContextMenuManager(@getLoadSettings().devMode)
|
||||
@config = new Config()
|
||||
@pasteboard = new Pasteboard()
|
||||
@keymap = new KeyMap()
|
||||
@syntax = deserialize(@getWindowState('syntax')) ? new Syntax()
|
||||
|
||||
getCurrentWindow: ->
|
||||
remote.getCurrentWindow()
|
||||
@ -72,7 +75,7 @@ class Atom extends Subscriber
|
||||
@rootView = new RootView()
|
||||
state.set('rootView', @rootView.getState())
|
||||
|
||||
$(rootViewParentSelector).append(rootView)
|
||||
$(@rootViewParentSelector).append(rootView)
|
||||
|
||||
@subscribe @project, 'path-changed', ->
|
||||
projectPath = project.getPath()
|
||||
|
@ -26,14 +26,10 @@ displayWindow = ->
|
||||
# This method is called in any window needing a general environment, including specs
|
||||
window.setUpEnvironment = (windowMode) ->
|
||||
atom.windowMode = windowMode
|
||||
#TODO remove once all packages use the atom global
|
||||
window.resourcePath = atom.getLoadSettings().resourcePath
|
||||
|
||||
Syntax = require './syntax'
|
||||
|
||||
window.rootViewParentSelector = 'body'
|
||||
#TODO remove once all packages use the atom globa
|
||||
window.config = atom.config
|
||||
window.syntax = deserialize(atom.getWindowState('syntax')) ? new Syntax
|
||||
window.syntax = atom.syntax
|
||||
window.pasteboard = atom.pasteboard
|
||||
window.keymap = atom.keymap
|
||||
|
||||
@ -105,7 +101,7 @@ window.onDrop = (e) ->
|
||||
|
||||
window.deserializeEditorWindow = ->
|
||||
atom.deserializeEditorWindow()
|
||||
#TODO remove once all packages use the atom globa
|
||||
#TODO remove once all packages use the atom global
|
||||
window.project = atom.project
|
||||
window.rootView = atom.rootView
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user