mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Trigger a notification when there is a keymap issue
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = ->
|
||||
|
||||
Reference in New Issue
Block a user