diff --git a/package.json b/package.json index c6d1f24bc..446ccedd1 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "atomShellVersion": "0.19.4", "dependencies": { "async": "0.2.6", - "atom-keymap": "^2.2.2", + "atom-keymap": "^2.3.0", "bootstrap": "git+https://github.com/atom/bootstrap.git#6af81906189f1747fd6c93479e3d998ebe041372", "clear-cut": "0.4.0", "coffee-script": "1.7.0", diff --git a/src/atom.coffee b/src/atom.coffee index a8b4a8ff0..e9c773ffe 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -249,6 +249,7 @@ class Atom extends Model @config = new Config({configDirPath, resourcePath}) @keymaps = new KeymapManager({configDirPath, resourcePath}) @keymap = @keymaps # Deprecated + @keymaps.subscribeToFileReadFailure() @tooltips = new TooltipManager @notifications = new NotificationManager @commands = new CommandRegistry diff --git a/src/keymap-extensions.coffee b/src/keymap-extensions.coffee index 754bd502a..d0237c432 100644 --- a/src/keymap-extensions.coffee +++ b/src/keymap-extensions.coffee @@ -23,6 +23,10 @@ KeymapManager::loadUserKeymap = -> if fs.isFileSync(userKeymapPath) @loadKeymap(userKeymapPath, watch: true, suppressErrors: true) +KeymapManager::subscribeToFileReadFailure = -> + this.onDidFailToReadFile (error) -> + atom.notifications.addError('Failed to load keymap.cson', {detail: error.stack, closable: true}) + # This enables command handlers registered via jQuery to call # `.abortKeyBinding()` on the `jQuery.Event` object passed to the handler. jQuery.Event::abortKeyBinding = ->