Skip to content

(feat) Make the code-folding gutter configurable via styles and options - #52

Open
rakasha681 wants to merge 1 commit into
jakepoz:masterfrom
rakasha681:feat-folding-options
Open

(feat) Make the code-folding gutter configurable via styles and options#52
rakasha681 wants to merge 1 commit into
jakepoz:masterfrom
rakasha681:feat-folding-options

Conversation

@rakasha681

Copy link
Copy Markdown
Contributor

Add a "folding" style element and an Editor Options toggle so the fold gutter's appearance and availability can be customized, building on thenew folding feature.

Style-driven appearance (FoldingManager, styles/*.xml):

  • Fold icon color now reads from the active style instead of a hardcoded gray, resolved the same way as syntax colors and refreshed live on a theme change.
  • Icon shape is selectable via shape="triangle" (default) or shape="plusminus" for boxed +/- markers.
  • Always-on guide lines run from each expanded block's icon down to its end line (with an end foot), colored by , defaulting to the icon color dimmed toward the editor background.
  • All bundled themes gain a element with instructional comments documenting these attributes; dark ships with plusminus as a default.

Enable/disable option (OptionsShell, Config, EditorComposite, MainShell):

  • New "Enable code folding" checkbox under "Display line numbers", defaulting to enabled. When off, editors open without a FoldingManager, so icons, hotkeys, the fold gutter, and unfold-on-save all go inert via the existing null-guards.
  • Disabling and saving unfolds all open editors and tears down their fold gutter live (FoldingManager now unregisters its listeners on dispose); enabling applies on next editor open to preserve listener ordering.
  • The setting is stored inverted (foldingDisabled) so existing serialized configs, which predate the field, still default to enabled.

Add a "folding" style element and an Editor Options toggle so the fold gutter's appearance and availability can be customized, building on thenew folding feature.

Style-driven appearance (FoldingManager, styles/*.xml):
- Fold icon color now reads <folding fgColor="..."/> from the active style instead of a hardcoded gray, resolved the same way as syntax colors and refreshed live on a theme change.
- Icon shape is selectable via shape="triangle" (default) or shape="plusminus" for boxed +/- markers.
- Always-on guide lines run from each expanded block's icon down to its end line (with an end foot), colored by <folding guideColor="..."/>, defaulting to the icon color dimmed toward the editor background.
- All bundled themes gain a <folding> element with instructional comments documenting these attributes; dark ships with plusminus as a default.

Enable/disable option (OptionsShell, Config, EditorComposite, MainShell):
- New "Enable code folding" checkbox under "Display line numbers", defaulting to enabled. When off, editors open without a FoldingManager, so icons, hotkeys, the fold gutter, and unfold-on-save all go inert via the existing null-guards.
- Disabling and saving unfolds all open editors and tears down their fold gutter live (FoldingManager now unregisters its listeners on dispose); enabling applies on next editor open to preserve listener ordering.
- The setting is stored inverted (foldingDisabled) so existing serialized configs, which predate the field, still default to enabled.
@thechillman422

Copy link
Copy Markdown
Collaborator

WOW that was fast :D I'll take a look. Thanks !!

Bruce

@rakasha681

Copy link
Copy Markdown
Contributor Author

wasn't much to it, i tried to make it in before you merged, but just missed it, so added the couple other bells and whistles related to it, which was mostly just cut and paste from my clone since it was already set up in that one :D Let me know if any tweaks are needed, but i haven't had any issues with it in testing the past few weeks. Should wrap up the closure of #34 :)

@thechillman422

Copy link
Copy Markdown
Collaborator

:) I'll test this for another week, then I'll pull the commit. Thank you.

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