Don’t leave line selected when switching blobs

Fixes #906

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
This commit is contained in:
Thomas Scholtes
2023-07-07 07:41:51 +02:00
parent e0e659f54a
commit 092f8ad774
3 changed files with 14 additions and 5 deletions
+2 -1
View File
@@ -63,9 +63,10 @@
</style>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
{title}
role="button"
tabindex="0"
on:click
class="square-button"
class:active
+4 -1
View File
@@ -27,7 +27,10 @@
$: content = highlighted ? lineNumbersGutter(highlighted) : undefined;
let selectedLineId: string | undefined = undefined;
updateSelectedLineId();
$: {
content;
updateSelectedLineId();
}
function updateSelectedLineId() {
const fragmentId = window.location.hash.substr(1);