#2764 closed enhancement (fixed)
[PATCH] Arbitrary line highlight in html preview
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.11 |
Component: | version control/browser | Version: | devel |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I'd like the ability to mark some lines of an html preview to draw someone's attention, using a specially-constructed url. I first noted this feature in cvsblame.cgi in use by the Mozilla project, and thus used its syntax as a model (example).
I'm attaching a diff against trunk in a second.
Attachments (3)
Change History (8)
by , 19 years ago
Attachment: | mimeview-annotate-marks2.diff added |
---|
by , 19 years ago
Attachment: | mimeview-annotate-marked-lines.diff added |
---|
Previous patch extended with support for source: #line source support
comment:1 by , 19 years ago
Milestone: | → 0.10 |
---|---|
Owner: | changed from | to
Severity: | normal → minor |
Status: | new → assigned |
Interesting. However, I think we should not advertise direct
manipulation of the URLs, but instead interface such features
with the WikiFormatting.
For example, we can adapt the Wiki syntax for specifying line
numbers so that it support ranges:
attachment:ticket:2764:mimeview-annotate-marked-lines.diff
by , 19 years ago
Attachment: | mimeview-annotate-marks4.diff added |
---|
Alternate syntax for specifying marks - source:/path/to/file@rev#L(20-25)19
comment:2 by , 19 years ago
That sounds good. Take this url - how should it be specified using the wiki syntax, where the line and first mark are different?
Although I dislike the added complication, but I would favor splitting up the hashref itself and the lines to mark, like source:/path/to/file@2#L(20-22,38,46-50)19
. This does not change the existing #L19
syntax, where your patch does (instead of just going to the line, it also marks it).
The marks4 patch uses this alternate syntax.
If the line and marks are jumbled together, I suggest making the line = max(0, Ranges(marks).pairs[0][0]-1)
, since that is sorted, and it's easier to read the preview with one line of context above the start of marks.
comment:3 by , 19 years ago
Milestone: | 0.10 → 0.11 |
---|
Could be done along side the blame support, in 0.11
comment:4 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Implemented in r4077.
I needed the Ranges code, so I've checked in the patch ;)
Some adaptations:
- the path link syntax is backward compatible, and the line anchor is only an anchor (i.e. it's not marked if not part of the range)
- the ranges are specified in a separate "argument", after the revision, before the optional anchor, e.g.
source:/path/to/file@2:20-22,38,46-50#L19
- as for the anchor, when specifying line ranges to be marked, the revision is mandatory (as it usually makes no sense to refer to a specific line number in any revision; if that's nevertheless the intent, one can specify an "empty" revision)
Thanks again for the patch!
Diff from r2905 to add line highlighting to browser html preview