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

The editor's state may not update correctly after multiple presses of cmd/ctrl+s #15308

Open
lessmost opened this issue Mar 27, 2025 · 0 comments

Comments

@lessmost
Copy link
Contributor

lessmost commented Mar 27, 2025

Bug Description:

Sometimes, when you quickly press Ctrl/Cmd+S multiple times, the editor's dirty state may not disappear.

Steps to Reproduce:

  1. Open an text file
  2. Make some edits, and intermediately press cmd/ctrl+s twice quickly
  3. Note that the editor's dirty state icon does not disappear.

It is easier to reproduce this issue when the saving process is slow. For example, you can easily reproduce it by adding an additional delay in MonacoEditorModel.doSave:

@@ -566,6 +566,11 @@ export class MonacoEditorModel implements IResolvedTextEditorModel, TextEditorDo
         try {
             const encoding = this.getEncoding();
             const version = this.resourceVersion;
+            await new Promise<void>(resolve => {
+                setTimeout(() => {
+                    resolve();
+                }, 3000);
+            });
             await Resource.save(this.resource, { changes, content, contentLength, options: { encoding, overwriteEncoding, version } }, token);
             this.contentChanges.splice(0, changes.length);
             this.resourceVersion = this.resource.version;

Additional Information

Screen record

Image

  • Operating System: MacOS 15.3.2
  • Theia Version: 1.59.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant