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

Fix Edited Indicator Behavior #1910

Merged
merged 3 commits into from
Oct 19, 2024
Merged

Conversation

Kihron
Copy link
Contributor

@Kihron Kihron commented Oct 17, 2024

Description

The edited indicator behavior now properly updates and aligns with Xcode's implementation.

The autosave() method provided by NSDocument automatically calls updateChangeCount accordingly. The else block in the function executed regardless of whether autosaving occurred or was enabled, triggering an unintended cleared state. As such, removing the direct call to updateChangeCount(.changeCleared) resolved the issue as the change count state is now handled properly by the autosave() method.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

With Manual Saving

Screen.Recording.2024-10-17.at.1.31.39.AM.mov

With Auto Save

Screen.Recording.2024-10-17.at.1.32.48.AM.mov

- The autosave() method provided by NSDocument automatically calls updateChangeCount accordingly, as such, removing the direct call to updateChangeCount with a value of .changeCleared resolves the issue
- This aligns with Xcode's current implementation
Copy link
Member

@tom-ludwig tom-ludwig left a comment

Choose a reason for hiding this comment

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

Could you please add a short comment above codeFile.autosave(...) to explain that updateChangeCount doesn’t need to be called manually?

@Kihron
Copy link
Contributor Author

Kihron commented Oct 18, 2024

Just added a comment 👍

Copy link
Member

@tom-ludwig tom-ludwig left a comment

Choose a reason for hiding this comment

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

Perfect 👊🏼. Thank you very much

@tom-ludwig tom-ludwig merged commit d92b5d9 into CodeEditApp:main Oct 19, 2024
2 checks passed
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.

3 participants