Skip to content

Improve Editor Configuration, Rename to SourceEditor #336

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

Merged

Conversation

thecoolwinter
Copy link
Collaborator

@thecoolwinter thecoolwinter commented Jun 17, 2025

Description

Improved the organization of our editor's configuration options by organizing them into a separate type from the SwiftUI API. This type is further organized into four structs based on the configuration option's effect on the editor.

Detailed Changes

  • Creates a new SourceEditorConfiguration struct.
    • Passed to CodeEditSourceEditor and TextViewController to update configuration.
    • One single object for all configuration that doesn't usually change during editing (no state is stored here).
    • Has an efficient method for updating the editor for a new configuration (moved from CodeEditSourceEditor's SwiftUI update method to SourceEditorConfiguration).
    • Organized into four categories: appearance, behavior, layout, and peripherals. Each has it's own documentation.
  • Adds a new API for toggling the gutter view.
  • Renames CodeEditSourceEditor to SourceEditor (requested by @austincondiff).
  • Updates docc docs to reflect new API.
  • Updates README to reflect new API (as well as a few missing/broken links).

I found a small bug with the refactor guide while making these changes. I may move them out of this PR.

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

N/A no content changes

@thecoolwinter thecoolwinter changed the title Rename to SourceEditor, Improve Editor Configuration Improve Editor Configuration, Rename to SourceEditor Jun 18, 2025
Copy link
Collaborator

@0xWDG 0xWDG left a comment

Choose a reason for hiding this comment

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

🚀

@thecoolwinter thecoolwinter merged commit bb72694 into CodeEditApp:main Jun 23, 2025
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.

✨ Config Getting Large ✨ Configuration to toggle line numbers visibility
4 participants