-
Notifications
You must be signed in to change notification settings - Fork 2.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
custom-editor: fix closing dirty custom text editor issue #11593
custom-editor: fix closing dirty custom text editor issue #11593
Conversation
… on CustomTextEditorProvider doesn't ask the user to save, it just save it on close #11592 The issue is that the autoSave member was undefined in the CustomTextEditorModel class, and it is used in the shouldSave method in saveable.ts file. The shouldSave method is called on close, and was returning true since the saveable.autoSave was undefined istead of invoking the cb() method.
…singDirtyCustomTextEditorIssue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution 👍
In order to accept your changes please be sure to sure to sign the eclipse contributor agreement (eca) with the same email as your authorship.
I already signed it. |
@safisa just the ECA for the moment, I verified and there does not seem to be a valid one registered yet (for [email protected]): |
I used my private email: [email protected] |
@safisa in order for the ECA check to actually pass you'll need to use the same email in both your authorship and ECA. From 02ec66c106d900818ff3ed9e92e0422c2f4522b9 Mon Sep 17 00:00:00 2001
From: Safi <[email protected]>
Date: Mon, 22 Aug 2022 14:52:53 +0300
Subject: [PATCH 1/2] This will fix the issue: Closing a dirty/modified custom
editor based on CustomTextEditorProvider doesn't ask the user to save, it
just save it on close https://github.com/eclipse-theia/theia/issues/11592
... |
Hi @vince-fugnitto @msujew |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed that the changes work well 👍
- if a custom-editor is dirty, closing the editor triggers the prompt
-
save
from the prompt will save the editor -
cancel
will close the dialog -
don't save
will revert the changes and close the editor
Hi @vince-fugnitto |
@safisa it should, I just wanted to give others a chance to review. |
What it does
Fix the issue: Closing a dirty/modified custom editor based on CustomTextEditorProvider doesn't ask the user to save, it just saves it on close (#11592)
How to test
Review checklist
Reminder for reviewers