mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Only add keybindings when command is present
This commit is contained in:
@@ -39,10 +39,10 @@ jQuery.fn.setTooltip = (tooltipOptions, {command, commandElement}={}) ->
|
||||
|
||||
tooltipOptions = {title: tooltipOptions} if _.isString(tooltipOptions)
|
||||
|
||||
bindings = if commandElement
|
||||
atom.keymap.keyBindingsForCommandMatchingElement(command, commandElement)
|
||||
else
|
||||
atom.keymap.keyBindingsForCommand(command)
|
||||
if commandElement
|
||||
bindings = atom.keymap.keyBindingsForCommandMatchingElement(command, commandElement)
|
||||
else if command
|
||||
bindings = atom.keymap.keyBindingsForCommand(command)
|
||||
|
||||
tooltipOptions.title = "#{tooltipOptions.title} #{getKeystroke(bindings)}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user