Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bceae355e3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let wordStart = wordEnd; | ||
| while (wordStart > 0 && !/\s/.test(textBeforeCursor[wordStart - 1])) { | ||
| wordStart--; |
There was a problem hiding this comment.
Treat punctuation as word boundaries in Ctrl+W
The new Ctrl+W reducer only checks \s to find word boundaries, so punctuation like /, ,, or - is treated as part of the word and gets deleted. That contradicts the function’s own docstring (“treating spaces and punctuation as word boundaries”) and typical terminal behavior where Ctrl+W stops at punctuation (e.g., /usr/local/bin should leave /usr/local/). As written, Ctrl+W will erase entire paths or flags containing punctuation, which is likely unexpected for users relying on terminal-like word deletion.
Useful? React with 👍 / 👎.
|
Superceded by #403 |
Add support for
ctrl+wto delete the word before the cursor. This binding is widely supported in terminals and cli tools.I tested this implementation, and seems to be working correctly. Also, see the unit tests which further describe the behavior of ctrl+w depending on the cursor position and text.
ctrl+wis not allowed to delete pasted segments.