Helix Select Mode (#37748)

Please credit @eliaperantoni, for the original PR (#34136).
Merge after (#34060) to avoid conflicts.

Closes https://github.com/zed-industries/zed/issues/33838
Closes https://github.com/zed-industries/zed/issues/33906

Release Notes:
- Helix will no longer sometimes fall out into "normal" mode, will
remain in "helix normal" (example: vv)
- Added dedicated "helix select" mode that can be targeted by
keybindings

Known issues:
- [ ] Helix motion, especially surround-add will not properly work in
visual mode, as it won't call `helix_move_cursor`. It is possible
however to respect self.mode in change_selection now.
- [ ] Some operations, such as `Ctrl+A` (increment) or `>` (indent) will
collapse selection also. I haven't found a way to avoid it.

---------

Co-authored-by: fantacell <ghub@giggo.de>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
Romans Malinovskis
2025-09-12 17:47:07 +02:00
committed by GitHub
co-authored by fantacell Conrad Irwin
parent a577128163
commit cba9ff55c7
9 changed files with 73 additions and 41 deletions
+1 -1
View File
@@ -398,7 +398,7 @@ impl Vim {
match self.mode {
Mode::Normal | Mode::HelixNormal => self.normal_object(object, count, window, cx),
Mode::Visual | Mode::VisualLine | Mode::VisualBlock => {
Mode::Visual | Mode::VisualLine | Mode::VisualBlock | Mode::HelixSelect => {
self.visual_object(object, count, window, cx)
}
Mode::Insert | Mode::Replace => {