Commit 7f5b255c authored by Robert Speicher's avatar Robert Speicher

Minor style fixes for LineHighlighter

parent e59aad6e
...@@ -73,7 +73,7 @@ class @LineHighlighter ...@@ -73,7 +73,7 @@ class @LineHighlighter
lineNumber = $(event.target).data('line-number') lineNumber = $(event.target).data('line-number')
current = @hashToRange(@_hash) current = @hashToRange(@_hash)
unless current[0] and event.shiftKey unless current[0] && event.shiftKey
# If there's no current selection, or there is but Shift wasn't held, # If there's no current selection, or there is but Shift wasn't held,
# treat this like a single-line selection. # treat this like a single-line selection.
@setHash(lineNumber) @setHash(lineNumber)
...@@ -105,9 +105,9 @@ class @LineHighlighter ...@@ -105,9 +105,9 @@ class @LineHighlighter
hashToRange: (hash) -> hashToRange: (hash) ->
matches = hash.match(/^#?L(\d+)(?:-(\d+))?$/) matches = hash.match(/^#?L(\d+)(?:-(\d+))?$/)
if matches and matches.length if matches && matches.length
first = parseInt(matches[1]) first = parseInt(matches[1])
last = matches[2] and parseInt(matches[2]) or null last = if matches[2] then parseInt(matches[2]) else null
[first, last] [first, last]
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment