-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Unsaved changes indicator in editor tab #1441
Conversation
I'd be glad to investigate this issue and try to identify the bug. Could you please assign the issue to me? |
@activcoding I've added you to the PR. I've put the |
I checked where is the problem, there are actually 2 problems: First problem with:
Second problem is that at point when This one a bit harder to fix (at least for me), since I created branch on my account with fixes to both problems - unsaved-changes-tab-indicator...avinizhanov:CodeEdit:unsaved-changes-tab-indicator
So we can listen to Works good on my machine. If you ok with these changes I can create a PR. |
@avinizhanov that is fantastic, yeah, create the PR! I also discovered |
@austincondiff I didn't know there is |
Thanks for your solution, @avinizhanov. I only noticed a minor bug – when I press 'Enter' to add a new line, it doesn't detect a file change. Is this the intended behavior? I ask because in VSCode, a new line is considered an edit. |
@avinizhanov that is where @activcoding and I were at. We weren't sure how to listen for changes either. Let us know if you find anything out. If we have to though, we can merge your PR in for the time being until we find a better solution. |
@austincondiff I'll try to find a way to listen for |
@activcoding
It's not intended, I missed that. This not triggered on enter:
|
The only solution I found is by overriding:
and creating custom publisher. First one is called when document is changed, second one when document is saved. Note: To test this you need to disable autosave in settings, currently autosave triggered on each update, which updates @activcoding Enter key bug is not fixed. Looks like it's a bug (or feature) of |
Yeah we figured it might need to be overridden. Thanks for carrying us to the finish line! 🏁 |
@avinizhanov Also it should also show when undoing past the saved state. So confer the following scenario.
It currently is like this...
|
This will require somehow use same Also
I did a test and it works as in description: Screen.Recording.2023-10-14.at.7.42.48.PM.movAdding events to May be |
Thanks for looking into this. @thecoolwinter is working on a STTextView replacement, so this may be something that we take into account. |
@austincondiff I think this is not related to STTextView, if replacement will still use What we can do is make change Create
|
* Unsaved changes tab indicator, fix onReceive and force re-render when item.fileDocument changed * rename view to EditorFileTabCloseButton * override updateChangeCount and add isDocumentEdited Publisher, remove isDirty property * Use CEUndoManager in CodeFileDocument * update CodeEditTextView version
@austincondiff Lint failed on same file as in #1452
|
Not anymore! 😆 |
In my testing, it works as expected. Some things I've discovered that do not work that will need to be addressed later on:
|
I think I fixed this one. I can create separate PR when this one merged. Screen.Recording.2023-10-16.at.5.24.22.PM.mov |
@avinizhanov Very nice! Go for it, we just merged |
Description
When users make any change to a file without saving and autosave is turned off, an indicator will appear in the tab until the file is saved to let the user know there are unsaved changes.
Related Issues
Checklist
Screenshots