# Fix search/replace start of line anchor \(\#13920\) · gitcafe/zed

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

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

Visibility: public

Requested revision: c093bc8aa80bd3bfed8da9a115c693b22ca24cd5

Requested commit: c093bc8aa80bd3bfed8da9a115c693b22ca24cd5

Commit: c093bc8aa80bd3bfed8da9a115c693b22ca24cd5

Tree: 75353dd0c29d48bc10ad0a904f03b817275cf056

Author: Andy Weiss

Committer: GitHub

## Message

```
Fix search/replace start of line anchor (#13920)

This is related to #9428 

I noticed that doing a search and replace for the beginning of a line
`^` results in the trailing line being included in the search. This
seems to be because of the way the range is generated for generating
matches being the up to the start of the trailing line rather than up to
the end of the last line.

I added a test and took a stab at fixing it but it is a bit yolo as this
is the first time I've seen this codebase.
```

## Parents

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

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