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

Mark the page as changed on setText #1085

Conversation

jcgurango
Copy link
Contributor

I noticed an issue where the syscall editor.setText() would not cause the page to save. In fact, it doesn't mark the page as changed at all, which means navigating away from the page wouldn't even trigger the save since it won't save unless there are changes:

web/client.ts line 660:

            if (
              !this.ui.viewState.unsavedChanges ||
              this.ui.viewState.uiOptions.forcedROMode
            ) {

This means that even the "Remove Completed Tasks" function from the tasks plug will lose its changes if you navigate away. Only thing I'm not totally sure about here is whether we should also include this client.save() call or just let it be handled either manually by the userdev or by the auto-save but then that won't trigger until the page is navigated away from.

zefhemel added a commit that referenced this pull request Sep 24, 2024
saving files after local update with setTexrt
@zefhemel
Copy link
Collaborator

Thanks for attempting this, but there's some subtle edge cases that this code is supposed to handle. So I fixed it slightly differently, let me know if this solves your issue too: 28f3e45

@zefhemel zefhemel closed this Sep 24, 2024
@jcgurango
Copy link
Contributor Author

Just commenting to verify it does indeed fix the issue.

@jcgurango jcgurango deleted the fix/mark-page-dirty-on-setText branch October 7, 2024 12:05
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

Successfully merging this pull request may close these issues.

2 participants