   clickHandler: (event) =>
     event.preventDefault()
 
+    @clearHighlight()
+
     lineNumber = $(event.target).data('line-number')
     current = @hashToRange(@_hash)
-
-    # Unhighlight previously highlighted lines
-    $('.hll').removeClass('hll')
 
     if isNaN(current[0]) or !event.shiftKey
       # If there's no current selection, or there is but Shift wasn't held,


      @setHash(range[0], range[1])
      @highlightRange(range)

  # Convert a URL hash String into line numbers
  #

    else
      hash = "#L#{firstLineNumber}-#{lastLineNumber}"

    @_hash = hash
    @__setLocationHash__(hash)

  # Make the actual hash change in the browser
  #
  # This method is stubbed in tests.
  __setLocationHash__: (value) ->
    # We're using pushState instead of assigning location.hash directly to
    # prevent the page from scrolling on the hashchange event
    history.pushState({turbolinks: false, url: value}, document.title, value)
