Gerrnperl / outline-map

A visual, interactive outline map that combines the clarity of the outline with the intuitive overview of the minimap. Alternative Minimap.
https://marketplace.visualstudio.com/items?itemName=Gerrnperl.outline-map
MIT License
228 stars 17 forks source link

有时一片空白,需要手动开关大纲会再次出现 #69

Open sinlatansen opened 6 months ago

sinlatansen commented 6 months ago

描述Bug 我使用这个插件编辑C语言工程,我习惯把他放在vscode左侧栏。 如果我打开左侧栏,我切换标签页,他也能正常切换。 但是如果我关闭左侧栏,此时我切换标签页,再打开左侧栏,就会一片空白,需要手动点击大纲,才可以再次出现内容

复现 关闭最侧栏,切换标签页,打开左侧栏,空白。

期望表现

截屏/录屏

https://github.com/Gerrnperl/outline-map/assets/122800302/abf84557-a4ae-4175-9789-a651707d1ef6

信息

附加信息

ncbbcc commented 2 months ago

我也出现了,先切到其他tab(比如资源管理器),再切换文件,再切到outline map会出现空白的情况。切换outline map的显示隐藏或者切换文件,可以恢复

joshua-dean commented 2 months ago

I think I've deduced the issue.

When OutlineView.view is hidden, the Webview can't receive messages. From the Webview API Docs:

Messages are only delivered if the webview is live

So, if you switch tab while the view is hidden, it doesn't receive the update messages, but OutlineView thinks it has. On the next update (OutlineView.view.onDidChangeVisibility), the Patcher doesn't think there's any new messages to send.

Fix is to not perform updates when the view isn't visible: https://github.com/joshua-dean/outline-map/commit/feea123e58d530ddcc414db64bb6ef080dde2f51

I will open a PR shortly.