From mboxrd@z Thu Jan 1 00:00:00 1970 From: andy at warmcat.com (Andy Green) Date: Wed, 20 Jun 2018 17:39:53 +0800 Subject: Highlighting lines or line ranges in tree view Message-ID: Hi - It's convenient to be able to provide a URL that points to a specific line in tree view. cgit provides links on the line numbers it produces to facilitate that, eg https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/ws-server/minimal-ws-server-echo/minimal-ws-server-echo.c#n43 However when you get there, there is no visual indication about the specific line. If the line happens to be early enough in the file that the end of the file is not in view, then the line is vertically arranged by the browser to be the first visible line. But if not, at least in firefox the vertical position is arranged so the last line of the file appears at the bottom and the first visible line is whatever it happens to be then, unrelated to the target in the URL. I guess with some JS and planning, it would be possible to have the page parse the raw URL and highlight the matching lines, also ranges of lines from URLs like ...#n43-48 But I think today, there's no JS in cgit. What's the feeling about this kind of enhancement? Stuff will be no worse than it is now if JS is disabled on the client. If JS in cgit is not verboten, what considerations should we think about from maintainability, security standpoints when integrating it? -Andy