Only add keybindings when command is present

This commit is contained in:
Kevin Sawicki 2014-03-26 17:34:09 -07:00
parent 4aa612e70c
commit 6948183270

View File

@ -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)}"