Skip to content

Commit

Permalink
Merge pull request edubkendo#69 from yasuyuky/master
Browse files Browse the repository at this point in the history
Add abortKeyBinding to allow overloading keymaps
  • Loading branch information
edubkendo committed Apr 12, 2016
2 parents 3b89be4 + 47e5aac commit 8500ad4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/racer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ module.exports =
@subscriptions = new CompositeDisposable

# Register command that does find-definition
@subscriptions.add atom.commands.add 'atom-workspace', 'racer:find-definition': =>
@findDefinition()
@subscriptions.add atom.commands.add 'atom-workspace', 'racer:find-definition': (e)=>
@findDefinition(e)

getRacerProvider: ->
return @racerProvider if @racerProvider?
Expand All @@ -59,11 +59,12 @@ module.exports =
@subscriptions?.dispose()
return

findDefinition: ->
findDefinition: (e)->
textEditor = atom.workspace.getActiveTextEditor()
grammar = textEditor?.getGrammar()

if !grammar or grammar.name != 'Rust' or textEditor.hasMultipleCursors()
e.abortKeyBinding()
return

cursorPosition = textEditor.getCursorBufferPosition()
Expand Down

0 comments on commit 8500ad4

Please sign in to comment.