mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Assign keymaps in Atom environment constructor
This commit is contained in:
@@ -168,6 +168,10 @@ class Atom extends Model
|
||||
Config = require './config'
|
||||
@config = new Config({configDirPath, resourcePath, notificationManager: @notifications})
|
||||
|
||||
KeymapManager = require './keymap-extensions'
|
||||
@keymaps = new KeymapManager({configDirPath, resourcePath, notificationManager: @notifications})
|
||||
|
||||
|
||||
reset: ->
|
||||
@config.reset()
|
||||
|
||||
@@ -204,7 +208,6 @@ class Atom extends Model
|
||||
|
||||
@loadTime = null
|
||||
|
||||
KeymapManager = require './keymap-extensions'
|
||||
ViewRegistry = require './view-registry'
|
||||
CommandRegistry = require './command-registry'
|
||||
TooltipManager = require './tooltip-manager'
|
||||
@@ -227,7 +230,6 @@ class Atom extends Model
|
||||
# Make react.js faster
|
||||
process.env.NODE_ENV ?= 'production' unless devMode
|
||||
|
||||
@keymaps = new KeymapManager({configDirPath, resourcePath})
|
||||
@keymaps.subscribeToFileReadFailure()
|
||||
@tooltips = new TooltipManager
|
||||
@commands = new CommandRegistry
|
||||
|
||||
@@ -41,11 +41,11 @@ KeymapManager::loadUserKeymap = ->
|
||||
[this document][watches] for more info.
|
||||
[watches]:https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md#typeerror-unable-to-watch-path
|
||||
"""
|
||||
atom.notifications.addError(message, {dismissable: true})
|
||||
@notificationManager.addError(message, {dismissable: true})
|
||||
else
|
||||
detail = error.path
|
||||
stack = error.stack
|
||||
atom.notifications.addFatalError(error.message, {detail, stack, dismissable: true})
|
||||
@notificationManager.addFatalError(error.message, {detail, stack, dismissable: true})
|
||||
|
||||
KeymapManager::subscribeToFileReadFailure = ->
|
||||
@onDidFailToReadFile (error) =>
|
||||
@@ -57,6 +57,6 @@ KeymapManager::subscribeToFileReadFailure = ->
|
||||
else
|
||||
error.message
|
||||
|
||||
atom.notifications.addError(message, {detail, dismissable: true})
|
||||
@notificationManager.addError(message, {detail, dismissable: true})
|
||||
|
||||
module.exports = KeymapManager
|
||||
|
||||
Reference in New Issue
Block a user