prompt-toolkit / prompt-toolkit/python-prompt-toolkit
Vi-mode `cw` inconsistent with actual vi
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Description
In Vi,
"cw" and "cW" are treated like "ce" and "cE" if the cursor is on a non-blank. This is because "cw" is interpreted as change-word, and a word does not include the following white space.
-- http://vimdoc.sourceforge.net/htmldoc/motion.html#word-motions
This means that, if I type "brew search xonsh" in Vi(m), with my cursor placed at the beginning of 'search'; cw will allow me to type install<esc> to change the sentence to "brew install xonsh".
In prompt_toolkit however, the same process would result in "brew installxonsh".
It may sound trivial, but since vim-users will spend more time using vim commands in vim than anywhere else, it's hard to remember the different behaviour and may cause problems.
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 at the Vi-mode handling for cw and cW, using the reported brew search xonsh sequence to reproduce the difference from Vim. Trace how the change operation selects trailing whitespace, then verify that completing the command produces brew install xonsh rather than brew installxonsh.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100