Add rootView.activeKeybindings().

This will return all active keybindings available for the focused element.
This commit is contained in:
Corey Johnson
2012-05-29 14:27:22 -07:00
parent 64bd26a392
commit 893564945e
4 changed files with 31 additions and 3 deletions

View File

@@ -32,7 +32,6 @@ class Keymap
while currentNode.length
bindingSets = @bindingSets.filter (set) -> currentNode.is(set.selector)
console.log @bindingSets, currentNode
bindingSets.sort (a, b) -> b.specificity - a.specificity
for bindingSet in bindingSets

View File

@@ -114,6 +114,9 @@ class RootView extends View
if not previousActiveEditor or editor.buffer.path != previousActiveEditor.buffer.path
@trigger 'active-editor-path-change', editor.buffer.path
activeKeybindings: ->
keymap.bindingsForElement(document.activeElement)
setTitle: (title='untitled') ->
document.title = title