Learn more about these different git repos.
Other Git URLs
A link to a particular line in a source file should not only scroll to it, but also somehow indicate which line it is.
Example link: https://pagure.io/pagure/blob/master/f/createdb.py#_11
I have implemented this as a user script, but having it work automatically would be nice (esp. not having to inject a stylesheet). A useful extension would be to enable linking to a line range (example, Shift+click selects range).
function updateHighlight() { var cls = "highlighted-line"; $('.' + cls).removeClass(cls) if (location.hash !== '') { var lineno = location.hash.substr(2); $('[data-line-number=' + lineno + ']').parents('tr').addClass(cls); } } $(document).ready(function () { $("head").append("<style>.highlighted-line{background-color:#FFFABA;}</style>"); updateHighlight(); }); $(window).on('hashchange', updateHighlight);
Fixed in https://pagure.io/pagure/pull-request/550
Log in to comment on this ticket.