mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Add mappingsForKeystrokeMatchingElement
This commit is contained in:
@@ -82,8 +82,7 @@ class Keymap
|
||||
element = event.target
|
||||
element = rootView[0] if element == document.body
|
||||
keystroke = @keystrokeStringForEvent(event, @queuedKeystroke)
|
||||
mappings = @mappingsForKeystroke(keystroke)
|
||||
mappings = @mappingsMatchingElement(mappings, element)
|
||||
mappings = @mappingsForKeystrokeMatchingElement(keystroke, element)
|
||||
|
||||
if mappings.length == 0 and @queuedKeystroke
|
||||
@queuedKeystroke = null
|
||||
@@ -118,6 +117,10 @@ class Keymap
|
||||
|
||||
mappings
|
||||
|
||||
mappingsForKeystrokeMatchingElement: (keystroke, element) ->
|
||||
mappings = @mappingsForKeystroke(keystroke)
|
||||
@mappingsMatchingElement(element, mappings)
|
||||
|
||||
mappingsForKeystroke: (keystroke) ->
|
||||
mappings = @allMappings().filter (mapping) ->
|
||||
multiKeystroke = /\s/.test keystroke
|
||||
|
||||
Reference in New Issue
Block a user