Open ziiirozone opened 4 weeks ago
The opening to new window function usually works well when the layout simply looks like following:
But thing goes worse rapidly in other layouts, and we don't know how many layouts we should adapt to. I believe this is likely a fun twist to tune for previewing, and it is not quite related to tinymist's core function. The current algorithm is used here:
I have no knowledge on how vs. code works or even how to program in typescript, but wouldn't it be possible to loop over each editor until one is found with a title matching that of the preview ?
but wouldn't it be possible to loop over each editor until one is found with a title matching that of the preview ?
May be.
I'm seeing this quite frequently too. I'm trying to find some recipe in order to reproduce it in a more reliable fashion, still to no avail. By now I do can say that:
Sometimes it happens even in the basic layout described above, but it might be that this is after having opened another previews (and then closed them), or because of having other files at the left group, or some of them being typ files, IDK, I can say it happens quite often but I still haven't found the pattern.
Usually, when this happens, I close the just opened dup tab, interact with the original one (just click on the editor or scroll a bit) and then the preview gets aware of this file again. But after that I might scroll the preview and click at another location and a bogus tab is opened one more time. It's quite random.
Ok, here's a reliable way to make it happen:
At that point you should have:
Describe the bug Hello ! I'm currently working with vs code on two different typst files, which I both have previews of. For the sake of explainations I'll number them file 1, file 2 & preview 1, preview 2. When I interact with file 1 and click on a word in preview 1 everything works as expected, but when I click on a word in preview 2, a new window with file 2 opens with the cursor on the word I clicked on. I now have 2 windows with file 2 open. When I double click on a word of preview 2 it seems to remember the first instance of file 2 and goes back to it. This makes working on multiple typst files quite difficult.
VSCode version :
tinymist version 0.11.19