cyrusfirheir / twee3-language-tools

[ VSCode extension ] Syntax highlighting and programmatic language tools for Twee 3, and Twine 2 storyformats.
https://marketplace.visualstudio.com/items?itemName=cyrusfirheir.twee3-language-tools
MIT License
47 stars 15 forks source link

Story Map view resets when going to it from another file/tab #146

Open Meorge opened 1 year ago

Meorge commented 1 year ago

When I leave the Story Map tab and then go back to it, the position resets to the origin. (I'm not closing the Story Map tab; it remains in the "open files" area the whole time.) I think this behavior is new - I thought it had been keeping its position in the past?

https://github.com/cyrusfirheir/twee3-language-tools/assets/9957987/34de64d1-b48f-4d90-9080-719af53745b9

cyrusfirheir commented 1 year ago

This behavior is same as before. If you lock it to a side panel, it'll retain the position. When any webview goes out of view, it is destroyed to reclaim system resources because webviews are expensive. This behavior can be opted out of by the extension, but is generally not recommended.

On an aside, if you want to use the map like you are, in its own tab, try the browser version. It is available under the following setting:

Twee3 Language Tools > Story Map: Window Type
Meorge commented 1 year ago

Hm ok, I must have just imagined it then. I'll give the browser version a try. Thanks for the quick response! 😄

It's not a high priority item, but in the future I wonder if it might be possible to have the position be cached and then reloaded when the webview is recreated, to make it feel like it's retaining its position? (Maybe one day I could try to contribute that...?)

cyrusfirheir commented 1 year ago

Should be simple enough to do, is just one coordinate to keep track of.