Skip to content

Create key_binding_utils.py and migrate functions to it#1814

Merged
rolandwalker merged 1 commit intomainfrom
RW/create-key-binding-utils
Apr 4, 2026
Merged

Create key_binding_utils.py and migrate functions to it#1814
rolandwalker merged 1 commit intomainfrom
RW/create-key-binding-utils

Conversation

@rolandwalker
Copy link
Copy Markdown
Contributor

Description

Create key_binding_utils.py and migrate functions to it.

Motivation: move code out of main.py.

This may be a bit overenthusiastic, as all command handlers are moved there, even the \clip handler, which does not have a keybinding. And maybe "handlers" are not a fit with "utils".

As a comment notes, the handlers might be better moved later to a repl_handlers.py. But that move would be premature before we have a repl.py.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

@rolandwalker rolandwalker self-assigned this Apr 4, 2026
and migrate functions to it.

Motivation: move code out of main.py.

This may be a bit overenthusiastic, as all command handlers are moved
there, even the \clip handler, which does not have a keybinding.  And
maybe "handlers" are not a fit with "utils".

As a comment notes, the handlers might be better moved later to a
repl_handlers.py.  But that move would be premature before we have a
repl.py.
@rolandwalker rolandwalker force-pushed the RW/create-key-binding-utils branch from d668bd2 to 2b6d06c Compare April 4, 2026 15:25
@rolandwalker rolandwalker merged commit 5cc9354 into main Apr 4, 2026
8 checks passed
@rolandwalker rolandwalker deleted the RW/create-key-binding-utils branch April 4, 2026 15:28
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.

1 participant