# editor: Fix extra characters were being written at the end of an HTML tag \(\#28529\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 64241f7d2f7086c4ce6cf01b8dd3a92e0a2db8e3

Requested commit: 64241f7d2f7086c4ce6cf01b8dd3a92e0a2db8e3

Commit: 64241f7d2f7086c4ce6cf01b8dd3a92e0a2db8e3

Tree: 709cb5a26bafc242eed9e9d34dcab7075c52a447

Author: Smit Barmase

Committer: GitHub

## Message

```
editor: Fix extra characters were being written at the end of an HTML tag (#28529)

Closes #25586

It is caused due to assumption all character being typed are word
characters and linked edit ranges can be used even when first non-word
character is typed. Because next character passes all the criteria like
being word character, anchor matching the previous range before typing
started, wrong edit take place.

This PR fixes it by clearing linked edit ranges when non-word character
is typed.

Before:

`<div cx^></div>cx` when typing fast.

After:

`<div cx^></div>` always.


Release Notes:

- Fixed a case where extra characters were being written at the end of
an HTML tag.
```

## Parents

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

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