Skip to content

Fix FormattingHook crash on activation events#957

Merged
LexiconCode merged 1 commit intodictation-toolbox:masterfrom
LexiconCode:fix/formatting-hook-activation-event
Mar 16, 2026
Merged

Fix FormattingHook crash on activation events#957
LexiconCode merged 1 commit intodictation-toolbox:masterfrom
LexiconCode:fix/formatting-hook-activation-event

Conversation

@LexiconCode
Copy link
Copy Markdown
Member

@LexiconCode LexiconCode commented Mar 16, 2026

Summary

  • Fixes Error while running Formatting Hook  #726FormattingHook.run() treated the event parameter as a dictionary (event_content["pronunciation"]), but HooksRunner.execute() passes a RuleActivationEvent object
  • Access event.rule_class_name and event.active attributes instead, matching the pattern used by PrinterHook
  • Only apply formatting on rule activation; clear formatting on deactivation

FormattingHook.run() treated the event as a dictionary, but
HooksRunner passes a RuleActivationEvent object. Access
event.rule_class_name and event.active attributes instead.
@LexiconCode LexiconCode added the BugFix Resolves unexpected behavior from existing features. label Mar 16, 2026
@LexiconCode LexiconCode self-assigned this Mar 16, 2026
@LexiconCode LexiconCode merged commit 2354994 into dictation-toolbox:master Mar 16, 2026
3 checks passed
@LexiconCode LexiconCode deleted the fix/formatting-hook-activation-event branch March 16, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BugFix Resolves unexpected behavior from existing features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error while running Formatting Hook

1 participant