Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Fix bug 1007293, blame link scrolls to selected line.#448

Closed
pelmers wants to merge 4 commits into
mozilla:esfrom
pelmers:sync-links
Closed

Fix bug 1007293, blame link scrolls to selected line.#448
pelmers wants to merge 4 commits into
mozilla:esfrom
pelmers:sync-links

Conversation

@pelmers
Copy link
Copy Markdown
Contributor

@pelmers pelmers commented Jul 1, 2015

Add an extra field to the FileToSkim.links() return tuple to indicate
whether to update to the selected line. Allow the code highlighter to
handle #l{number} in addition to #{number} so that we can re-use the
same code for links to Github, hg web, and permalinks.

Comment thread dxr/plugins/clang/indexers.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not your fault; it's mine for getting behind in reviews. But regions and refs now use actual classes for their return values, so let's take the opportunity to do so for links as well. Then, the next time we add something, we won't need to touch every line that deals with the data structure. :-)

Add an extra field to the FileToSkim.links() return tuple to indicate
whether to update to the selected line. Allow the code highlighter to
handle #l{number} in addition to #{number} so that we can re-use the
same code for links to Github, hg web, and permalinks.
Instead of True/False, links can return an anchor template string, where
{{start}} and {{end}} are replaced at highlight time by the selected
highlight range, if only one range is highlighted.
@pelmers
Copy link
Copy Markdown
Contributor Author

pelmers commented Jul 15, 2015

On a double check, I don't think that hg web supports region highlight at all. It seems to only have jump to line. I will change the template correspondingly.
Example: http://hg.mozilla.org/mozilla-central/file/9340658848d1/xpcom/idl-parser/xpidl.py#l10-l30

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants