jesseduffield / jesseduffield/lazygit
Treat ASCII/non-ASCII boundaries as word boundaries in text editing (word deletion, word movement)
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
For context, I'm Japanese. And I work with Japanese people. So I use Japanese and English in commit messages. (we use English only for proper nouns and technical terms, by the way)
### Is your feature request related to a problem? Please describe.
When I write a commit message using Lazygit, `ctrl+w` deletes consecutive characters regardless of whether they are ASCII or non-ASCII characters.
For example, when the current commit message is `関数名をDoSomethingに変更` (which means `rename function name to DoSomething`), if I press `ctrl+w` at the end of the line, all the characters are deleted.
### Describe the solution you'd like
`ctrl+w` only deletes consecutive characters of the same kind (ASCII or non-ASCII).
For example, when the current commit message is `関数名をDoSomethingに変更`, if I press `ctrl+w` at the end of the line, only `に変更` is deleted. (`ctrl+w` deletes only the consecutive non-ASCII characters in this example.)
In addition to this, for consistenc word movement should respect ASCII/non-ASCII boundaries as well.
### Describe alternatives you've considered
N/A
### Additional context
Many tools I use delete only consecutive characters of the same kind (ASCII or non-ASCII) as the character immediately before the cursor. (e.g. `ctrl+w` in Vim/Neovim and Claude Code, `opt+delete` in macOS and Emacs)
For reference, as far as I know these tools delete consecutive characters regardless of whether they are ASCII or non-ASCII characters.
- `ctrl+w` in zsh
- `opt+delete` in VSCode
---
@stefanhaller
I've opened a PR with an implementation.
If this sounds reasonable, I'd appreciate a review of my PR. https://github.com/jesseduffield/lazygit/pull/5804
Contributor guide
Research direction
Start by reviewing the implementation PR linked in the issue, #5804, and compare its behavior with the current text editing commands. Done means word deletion and movement stop at ASCII/non-ASCII boundaries, including the Japanese and English example described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100