Preserve copy_or_noop passthrough result#10041
Closed
M-Hassan-Raza wants to merge 2 commits into
Closed
Conversation
Contributor
Author
|
Hmmm I think the issue has been fixed upstream already? Great! I'll close the PR shortly in that case :D |
Owner
|
This PR was actually merged, not sure why github didnt auto close it. |
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.
This fixes a regression where copy_or_noop no longer passed the mapped key through when there was no active selection.
Window.copy_or_noop() already returns True in the no-selection case, and Boss.dispatch_action() uses exactly True to mean “do not consume this key”. The Boss.copy_or_noop() wrapper was calling the window method but not returning its result, so the True became None and the key was consumed.
I added a focused regression test for both paths: passthrough when the window returns True, and consumed when it returns False. The test is a little longer than the fix because it exercises the dispatcher behavior rather than just calling the wrapper directly. Happy to trim or reshape it if you prefer a smaller test.
Tested with:
./test.py --module keys
python3 -m py_compile kitty/boss.py kitty_tests/keys.py