-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
add option to close editor window on save #15
Conversation
Optimized the `onDocumentClose` function in the VSCode extension to manage the programmatic closure of text editors more effectively. Changes: - Moved the `isAutoClosingEditor` check to the top, ensuring early exit if an editor closure is programmatic. - The `isAutoClosingEditor` flag is now set immediately before the programmatic closure of the editor, ensuring precise tracking of such events. This refactor enhances the reliability of the editor closure mechanism and simplifies the logic flow for better maintainability.
Ok, looking this over more, it seems like there is no easy way to determine which of these scenarios actually trigger the onDidCloseTextDocument event:
|
As mentioned:
What you want to listen to is the disconnection event specifically (see the If you are already in the editor, you can disconnect by closing the tab, so I'm not sure this will get you what you want in the end. |
Ok, what about something like this: set a new configuration option
set up a new event listener for
and then close on save
|
The only problem I'm having is |
No. It's a bug and it will be fixed. |
I'll go ahead and close this out. |
Ensure text editor closes programmatically on document save, eliminating the need to manually close lingering windows.