# vim: Fix Helix mode subword motions to select traversed text \(\#45760\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/1f442da1d3597a51f9b1819ebdacfc25565a60b5)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 1f442da1d3597a51f9b1819ebdacfc25565a60b5

Requested commit: 1f442da1d3597a51f9b1819ebdacfc25565a60b5

Commit: 1f442da1d3597a51f9b1819ebdacfc25565a60b5

Tree: 004604f99cb85590bcf791bc2a400980ea4d82b0

Author: Max Malkin

Committer: GitHub

## Message

```
vim: Fix Helix mode subword motions to select traversed text (#45760)

Update Helix's handling of the following actions in order to ensure that
selections are created when using subword motions:

* `vim::NextSubwordStart`
* `vim::NextSubwordEnd`
* `vim::PreviousSubwordStart`
* `vim::PreviousSubwordEnd`

The handling of these motions was done by
`vim::helix::Vim::helix_move_and_collapse`, which simply moved the
cursor without doing any selection. This commit updates it to correctly
use both `vim::helix::Vim::helix_find_range_forward` and
`vim::helix::Vim::helix_find_range_backward`.

The added tests have been confirmed against Helix's behavior of the following commands:

* `move_next_sub_word_start`
* `move_prev_sub_word_start`
* `move_next_sub_word_end`
* `move_prev_sub_word_end`

Closes #41767

Release Notes:

- Fix subword motions in Helix mode to select traversed text

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
```

## Parents

- [e67cf996ba46ac933a3429820822bce6d41d8166](https://git.cafe/gitcafe/zed/commit/e67cf996ba46ac933a3429820822bce6d41d8166?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/1f442da1d3597a51f9b1819ebdacfc25565a60b5?format=markdown)
