Skip to content

Commit

Permalink
Merge pull request #196 from jannis-baum/issue/193-bug-n-file-suffix-…
Browse files Browse the repository at this point in the history
…doesnt-scroll-if-browser-firefox-wasnt-already-open

Bug: `:n` file suffix doesn't scroll if browser (firefox) wasn't already open
  • Loading branch information
tuurep authored Jan 7, 2025
2 parents 5d07d16 + 7abb2a5 commit 355ebb5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions static/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ function viv_scrollTo(value) {

const ws = new WebSocket(`ws://localhost:${window.VIV_PORT}`);

ws.addEventListener('open', () => {
ws.send(`PATH: ${window.VIV_PATH}`);
});

ws.addEventListener('message', (event) => {
const fields = event.data.toString().split(': ');
if (fields.length < 2) return;
Expand All @@ -40,3 +36,7 @@ ws.addEventListener('message', (event) => {
break;
}
});

ws.addEventListener('open', () => {
ws.send(`PATH: ${window.VIV_PATH}`);
});

0 comments on commit 355ebb5

Please sign in to comment.