Skip to content

Commit

Permalink
fix #67
Browse files Browse the repository at this point in the history
  • Loading branch information
yongkangchen committed May 15, 2015
1 parent 9f54c0b commit 12035dd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/highlighted-area-view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ class HighlightedAreaView extends View

subscribeToActiveTextEditor: ->
@selectionSubscription?.dispose()

editor = @getActiveEditor()
return unless editor

@selectionSubscription = new CompositeDisposable

@selectionSubscription.add @getActiveEditor()?.onDidAddSelection =>
@selectionSubscription.add editor.onDidAddSelection =>
@handleSelection()
@selectionSubscription.add @getActiveEditor()?.onDidChangeSelectionRange =>
@selectionSubscription.add editor.onDidChangeSelectionRange =>
@handleSelection()
@handleSelection()

Expand Down

0 comments on commit 12035dd

Please sign in to comment.