Skip to content

feat: add Ctrl+Alt+H keyboard shortcut to toggle highlight color#50

Open
MarsEB71 wants to merge 1 commit intoEuro-Office:mainfrom
MarsEB71:feat/ctrl-alt-h-highlight-shortcut
Open

feat: add Ctrl+Alt+H keyboard shortcut to toggle highlight color#50
MarsEB71 wants to merge 1 commit intoEuro-Office:mainfrom
MarsEB71:feat/ctrl-alt-h-highlight-shortcut

Conversation

@MarsEB71
Copy link
Copy Markdown

Summary

  • Adds Ctrl+Alt+H shortcut to the document editor toolbar
  • First press applies the current highlight color to selected text
  • Second press removes the highlight if the selection's color matches the current highlight color

How it works

Reads the highlight state directly from api.get_TextProps() on each keypress rather than relying on cached button state. Uses _setMarkerColor('transparent') (which calls SetMarkerFormat(true, false)) to remove the highlight — not SetMarkerFormat(false) which only exits painting mode without removing existing highlights.

Test plan

  • Select text → Ctrl+Alt+H → text highlighted in yellow
  • With highlighted text selected → Ctrl+Alt+H → highlight removed
  • Change highlight color via toolbar → Ctrl+Alt+H → applies new color
  • No text selected → Ctrl+Alt+H → no crash

Closes #55

🤖 Generated with Claude Code

Adds a keyboard shortcut that applies the current highlight color to
selected text on first press, and removes the highlight on a second
press if the selection's highlight matches the current color.

Closes Euro-Office#55

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@moodyjmz
Copy link
Copy Markdown
Member

Not sure if this gets added, I can't decide that unilaterally, however I would give some feedback generally

Why IIFE?
Why place the logic code into the init block?
Would it be better to have the logic as a named method alongside the other named methods?

I see you are using Claude. You can ask it to look at the existing patterns in the file and follow convention. :)

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.

Add smart picker to the web ui

2 participants