# editor: Expand selection to word under cursor before expanding to next enclosing syntax node \(\#28864\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 0d8f77b5dedea876b56cb53bc4eb5c0b081652b7

Requested commit: 0d8f77b5dedea876b56cb53bc4eb5c0b081652b7

Commit: 0d8f77b5dedea876b56cb53bc4eb5c0b081652b7

Tree: 6a4f53ca2397fea2caa083a48932c780d9cb0cf4

Author: Smit Barmase

Committer: GitHub

## Message

```
editor: Expand selection to word under cursor before expanding to next enclosing syntax node (#28864)

Closes #27995

For strings in any language and Markdown, `select_larger_syntax_node`
will first select the word and then expand from there if:
- The cursor is on the word.
- The selection is inside the word.

It will not select the word and will directly proceed to expand if:
- The word is already selected.
- Multiple partial words are selected.

Todo:
- [x] Tests

Release Notes:

- Fixed `select_larger_syntax_node` to first expand to the word within a
string, and then to the larger syntax node.
```

## Parents

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

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