# Cleanup handling of surrounding word logic, fixing crash in editor::SelectAllMatches \(\#33353\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 96409965e428ec54f3c994e5a6b7d6d7a561ed40

Requested commit: 96409965e428ec54f3c994e5a6b7d6d7a561ed40

Commit: 96409965e428ec54f3c994e5a6b7d6d7a561ed40

Tree: bb9aa29718c944905220409efc973e700891ae39

Author: Michael Sloan

Committer: GitHub

## Message

```
Cleanup handling of surrounding word logic, fixing crash in editor::SelectAllMatches (#33353)

This reduces code complexity and avoids unnecessary roundtripping
through `DisplayPoint`. Hopefully this doesn't cause behavior changes,
but has one known behavior improvement:

`clip_at_line_ends` logic caused `is_inside_word` to return false when
on a word at the end of the line. In vim mode, this caused
`select_all_matches` to not select words at the end of lines, and in
some cases crashes due to not finding any selections.

Closes #29823

Release Notes:

- N/A
```

## Parents

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

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