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
+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);