-
Notifications
You must be signed in to change notification settings - Fork 4
EditorAPI Refactor #71
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Aug 14, 2025
Closed
Closed
Closed
Closed
mkh-user
commented
Aug 15, 2025
…into mode-update
Wiechciu
approved these changes
Aug 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed, seems alright. Although keep in mind I don't understand half of that code yet =]
Last overall unit tests result:
|
Finally merged!!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
action scripts
Official action scripts or action scripts features
feature: AutoCompletion
feature: Navigation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
This update introduces a comprehensive and foundational refactor of the EditorAPI and related modules, with a particular focus on mode logic and structure. The previous system for handling modes was limited in flexibility, lacked modularity, and suffered from performance inefficiencies. This refactor replaces the old architecture with a cleaner, more extensible system that enables new features and better performance.
Action Scripts
Global
damage_modes
variable to track broken or incompatible modestemprory_children
variable to manage node catchingModes
Panels
remove_panel
method in PanelManagerEditor
EditorAPI
is_mode_compatible
method for validationchange_mode_to
method with full lifecycle supportCore
Related Items
Testing
Basic functionality tests have been performed for:
Full regression testing and edge case validation are currently in progress.
Impact
This refactor significantly improves performance by:
It also lays the groundwork for future extensibility, including custom mode features, better syntax highlighting, and enhanced editor responsiveness.
Additional Information
Modes now follow a standardized structure by extending the
TextForgeMode
class, which provides built-in utilities for common features. Key architectural changes include:🔧 Mode Initialization:
Modes can return error codes during initialization to cancel loading if incompatible.
🎨 Syntax Highlighting:
Each mode provides its own
syntax_highlighter
instance, which is shared with the editor.🧩 Mode Panels:
Modes can define a custom panel for user interaction, displayed on the left side of the editor.
📝 Auto Format & Auto Indent:
These features are now managed per mode. Action scripts read mode capabilities and enable/disable themselves accordingly. EditorAPI will manage requests and modes for safe actions.
💾 Saving & Loading:
Modes do not access files directly. Instead:
👁️ Preview System:
Modes can convert file content to BBCode for preview rendering. The new Preview panel displays this content.
🚨 Linting & Problems Panel:
Modes can analyze content and report warnings/errors. These are displayed in a dedicated problems panel with navigation support.
📑 Outline Panel:
Mods can outline the file. This information allows users to browse parts of the file and switch between them with Outline panel.
Checklist