-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onDidCloseTextEditor triggering on preview pane that is still open #14118
Comments
Yeah - open is defined as visible in an editor/pane and not as visible as tab. The latter is just a UI gesture to quickly open/restore a document (the obvious case is after a refresh, when tabs are restored but not documents). Likewise a tab that you never come back to is like a closed editor. Whatever dispose strategy one implements it's a tradeoff. Tho, it doesn't mean that you cannot trust the |
The problem is I need a way to know when the pane is actually closed so that I can properly clean up data that is no longer needed. Currently I have two options, just never clean up the data (which could have some pretty obvious performance problems); Or clean up the data on this current close request and have to go through and re create the data when I get the open request from vscode again, which would be a bad user experience and could have undesired side effects for the user. |
Run into the same issue as @anthonydresser with Vim.
Previous I didn't know that we define |
I was under the impression that onDidTextDocumentClose meant the tab was closed...not just switched away from... |
Related to #13623 . From that I learned that preview panes (virtual documents) have a 3 minute timer that clean ups unused virtual files. However, it appears as though this is attempting to clean up documents that are not closed, but simply not currently visible.
Open preview panes
onDidCloseTextEditor triggering for a preview pane I have open
This is a problem because this means we can not trust this onDidCloseTextDocument event in order to know when to clean up data, meaning we have to hold on to data forever. Is this expected behavior? Is there a
vscode.window.visibleTextEditors
but for all open files so we can check to see if a html pane has actually been closed?Steps to Reproduce:
The text was updated successfully, but these errors were encountered: