prompt-toolkit / prompt-toolkit/python-prompt-toolkit
forward-word doesn't quite match emacs/readline, and isn't configurable
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Description
Consider a(123), with the cursor at a. In both emacs and readline, M-f moves forward one character, to the (. In prompt-toolkit, it moves to the 1.
It also would be nice to be able to configure word boundaries. In particular, I would like to be able to make it so that AbcDef and abc_def are both treated as two words for the purposes of word movement/deletion. The current approach does a regex search, but I believe you need to tokenize the input.
Also worth noting that the docs for forward-word state that words are composed of letters and numbers, but the implementation includes underscores as well (and that behavior in particular does not match readline and is quite annoying).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with prompt_toolkit/key_binding/bindings/named_commands.py, especially the documented and implemented forward-word behavior. Compare its movement with emacs and readline for examples such as a(123), then determine how configurable boundaries should handle underscores and camel-case text. Done means word movement and deletion match the requested boundaries and the documentation matches the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100