diff --git a/lib/keybinding-resolver-view.js b/lib/keybinding-resolver-view.js index af47819..8123e90 100644 --- a/lib/keybinding-resolver-view.js +++ b/lib/keybinding-resolver-view.js @@ -13,6 +13,7 @@ export default class KeyBindingResolverView { this.unusedKeyBindings = [] this.unmatchedKeyBindings = [] this.partiallyMatchedBindings = [] + this.abortedBindings = [] etch.initialize(this) } @@ -41,7 +42,7 @@ export default class KeyBindingResolverView { this.panel = null })) - this.disposables.add(atom.keymaps.onDidMatchBinding(({keystrokes, binding, keyboardEventTarget, eventType}) => { + this.disposables.add(atom.keymaps.onDidMatchBinding(({keystrokes, binding, keyboardEventTarget, eventType, abortedBindings}) => { if (eventType === 'keyup' && binding == null) { return } @@ -49,12 +50,13 @@ export default class KeyBindingResolverView { const unusedKeyBindings = atom.keymaps .findKeyBindings({keystrokes, target: keyboardEventTarget}) .filter((b) => b !== binding) + .filter((b) => !abortedBindings.includes(b)) const unmatchedKeyBindings = atom.keymaps .findKeyBindings({keystrokes}) - .filter((b) => b !== binding && !unusedKeyBindings.includes(b)) + .filter((b) => b !== binding && !unusedKeyBindings.includes(b) && !abortedBindings.includes(b)) - this.update({usedKeyBinding: binding, unusedKeyBindings, unmatchedKeyBindings, keystrokes}) + this.update({usedKeyBinding: binding, unusedKeyBindings, unmatchedKeyBindings, keystrokes, abortedBindings}) })) this.disposables.add(atom.keymaps.onDidPartiallyMatchBindings(({keystrokes, partiallyMatchedBindings}) => { @@ -87,6 +89,7 @@ export default class KeyBindingResolverView { this.unusedKeyBindings = props.unusedKeyBindings || [] this.unmatchedKeyBindings = props.unmatchedKeyBindings || [] this.partiallyMatchedBindings = props.partiallyMatchedBindings || [] + this.abortedBindings = props.abortedBindings || [] return etch.update(this) } @@ -145,6 +148,13 @@ export default class KeyBindingResolverView {
{binding.command} | +{binding.selector} | +this.openKeybindingFile(binding.source)}>{binding.source} | +
{binding.command} | diff --git a/styles/keybinding-resolver.less b/styles/keybinding-resolver.less index 9485441..b0334f7 100644 --- a/styles/keybinding-resolver.less +++ b/styles/keybinding-resolver.less @@ -14,6 +14,10 @@ color: @text-color-success; } + .aborted { + color: @text-color-warning; + } + .unused { color: @text-color; } @@ -22,10 +26,14 @@ color: @text-color-subtle; } - .used .command, .unused .command{ + .used .command, .unused .command { .octicon(check); } + .aborted .command { + .octicon(stop); + } + .unmatched .command { .octicon(x); }