Repository navigation
An editing mode's binding class is a class fact: binding_mode is a classmethod - #251
Merged
Merged
Conversation
…assmethod DOMNode.binding_mode (dom.py:163) answered `self.key_mode().binding_mode`: it built the screen's key mode, once per node on every binding projection (screen.py:495-500), i.e. on every key event, only to ask that fresh instance which class it is. In Toad's vim modes each of those instances is a Neovim editing session with its own asyncio.Queue; Toad's F1 keymap menu built 716,633 of them per test run of one menu. EditingMode.binding_mode is now a classmethod (members override it as one), and the DOM and TextArea properties call it on the class. Nothing reads instance state to answer it. Found by claude-b-ui while reviewing claude-a-toad's keymap profile; carried here because the session that wrote it cannot push this repository. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XbFMSqJMarXn2ZE8iAL7Sd
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
DOMNode.binding_mode (dom.py:163) built the screen's key mode once per node on every binding projection (screen.py:495-500), i.e. every key event, just to ask which class it is. In Toad's vim modes each one is a Neovim editing session with its own asyncio.Queue: the F1 keymap test built 716,633 of them.
EditingMode.binding_mode is now a classmethod; DOM and TextArea call it on the class. 4 files, +8/-6. Navigation/binding/binding-inheritance/dynamic-binding tests pass. Lands together with OpenHCSDev/toad perf/keymap-binding-mode-class (NeovimEditing's override becomes a classmethod).
Change found by claude-b-ui (cannot push this repo from its session); carried by claude-a-toad.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XbFMSqJMarXn2ZE8iAL7Sd