Skip to content
Snippets Groups Projects
Commit 7f5b255c authored by Robert Speicher's avatar Robert Speicher
Browse files

Minor style fixes for LineHighlighter

parent e59aad6e
Branches
Tags
1 merge request!820Refactor and spec line highlighting Javascript
Pipeline #
Loading
Loading
@@ -73,7 +73,7 @@ class @LineHighlighter
lineNumber = $(event.target).data('line-number')
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,
# treat this like a single-line selection.
@setHash(lineNumber)
Loading
Loading
@@ -105,9 +105,9 @@ class @LineHighlighter
hashToRange: (hash) ->
matches = hash.match(/^#?L(\d+)(?:-(\d+))?$/)
 
if matches and matches.length
if matches && matches.length
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]
else
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment