Show which line is highlighted

Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
Alexis Sellier
2022-02-25 16:56:33 +01:00
parent a41c3cd293
commit cfb695d592
3 changed files with 13 additions and 8 deletions
+5 -3
View File
@@ -15,11 +15,13 @@
export let config: Config;
export let hash: string | null = null;
const line = formatLocationHash(hash);
const browse: proj.BrowseTo = { content, peer, path: "/", line };
const browse: proj.BrowseTo = { content, peer, path: "/" };
const head = project.branches[project.defaultBranch];
// route is passed when the URL has more params after e.g. /tree or /history
// If line-number hash changes, we update the browser.
$: browse.line = formatLocationHash(hash);
// `route` includes any unmatched path segments.
$: if (route) {
const { path, revision } = proj.parseRoute(route, project.branches);