diff --git a/root/static/js/syntaxhighlighter.js b/root/static/js/syntaxhighlighter.js index 4227a88ed8..207b95c5f4 100644 --- a/root/static/js/syntaxhighlighter.js +++ b/root/static/js/syntaxhighlighter.js @@ -218,9 +218,17 @@ $(function () { // the the link. instead, update the hash ourselves, but // unset the id first so it doesn't scroll e.preventDefault(); + + var line = linenr; + if (e.shiftKey && source.attr('data-line')) { + var startLine = parseLines(source.attr('data-line'))[0]; + line = startLine < line ? startLine + '-' + line + : line + '-' + startLine; + } link.removeAttr('id'); - document.location.hash = '#' + id; + document.location.hash = '#L' + line; link.attr('id', id); + source.attr('data-line', line); }); } });