close
Skip to content

Preserve copy_or_noop passthrough result#10041

Closed
M-Hassan-Raza wants to merge 2 commits into
kovidgoyal:masterfrom
M-Hassan-Raza:fix/copy-or-noop-passthrough
Closed

Preserve copy_or_noop passthrough result#10041
M-Hassan-Raza wants to merge 2 commits into
kovidgoyal:masterfrom
M-Hassan-Raza:fix/copy-or-noop-passthrough

Conversation

@M-Hassan-Raza
Copy link
Copy Markdown
Contributor

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

@M-Hassan-Raza
Copy link
Copy Markdown
Contributor Author

Hmmm I think the issue has been fixed upstream already? Great! I'll close the PR shortly in that case :D

@kovidgoyal
Copy link
Copy Markdown
Owner

This PR was actually merged, not sure why github didnt auto close it.

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.

2 participants