cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-119035: Add Ctrl+← and Ctrl+→ word-skipping keybindings to new repl

Open optim-ally opened this issue 1 year ago • 2 comments

Added missing keybindings for Ctrl+ and Ctrl+ in reader.py.

These should map to ctrl left and ctrl right but, as Tomas mentioned in #119035, those are treated as invalid characters by the keymap translator. This is due to an incorrect assumption that Ctrl can only be combined with a single character, so the logic in keymap.py needs a small change too.

As far as I can tell, "left" and "right" are the only only multi-character keynames that we need to map, so I've just added an explicit check for those two.

P.S. first-time contributor at PyCon US! Lmk if I've missed any steps in creating the PR.

  • Issue: gh-119035

optim-ally avatar May 20 '24 19:05 optim-ally

All commit authors signed the Contributor License Agreement.
CLA signed

ghost avatar May 20 '24 19:05 ghost

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

bedevere-app[bot] avatar May 20 '24 19:05 bedevere-app[bot]

Thanks @optim-ally for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. 🐍🍒⛏🤖

miss-islington-app[bot] avatar May 21 '24 16:05 miss-islington-app[bot]

GH-119323 is a backport of this pull request to the 3.13 branch.

bedevere-app[bot] avatar May 21 '24 16:05 bedevere-app[bot]

Thank you @optim-ally and congrats on your first commit to Python :)

hroncok avatar May 21 '24 19:05 hroncok