Skip to content
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

Keep undo history even when file changes outside Code. #29655

Merged
merged 5 commits into from Aug 28, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -413,7 +413,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
this.blockModelContentChange = true;
try {
this.updateTextEditorModel(value);
this.setDirty(false);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexandrudima I'm pretty sure this change was necessary. We need the model to know that this is now the current saved state.

If after reloading the file on disk, if you press undo it shows that the file is still saved, after a redo it shows the file is unsaved, and if you attempt to close the file it prompts you to save it, even though it is up to date.

Here's a gif where I modify the file with vim, press undo, then redo:
dirty

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stringham thanks we are looking into restoring that, you are right, it is needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stringham 👍 thank you ❤️ !

} finally {
this.blockModelContentChange = false;
}
Expand Down