Add link to code line numbers

Signed-off-by: Sebastian Martinez <sebastinez@me.com>
This commit is contained in:
Sebastian Martinez
2022-02-25 16:03:13 +01:00
committed by Alexis Sellier
parent 000e15c48a
commit a41c3cd293
6 changed files with 36 additions and 9 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
<script lang="ts">
import type { Writable } from 'svelte/store';
import type { Config } from "@app/config";
import { formatLocationHash } from '@app/utils';
import * as proj from '@app/project';
import Project from './Project.svelte';
@@ -12,8 +13,10 @@
export let content: proj.ProjectContent = proj.ProjectContent.Tree;
export let project: proj.Project;
export let config: Config;
export let hash: string | null = null;
const browse: proj.BrowseTo = { content, peer, path: "/" };
const line = formatLocationHash(hash);
const browse: proj.BrowseTo = { content, peer, path: "/", line };
const head = project.branches[project.defaultBranch];
// route is passed when the URL has more params after e.g. /tree or /history