# edit_prediction: Fix special token check matching \`=======\` inside comments \(\#52510\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 56104fb17e6c5849900a4c282f42d1bfea294121

Requested commit: 56104fb17e6c5849900a4c282f42d1bfea294121

Commit: 56104fb17e6c5849900a4c282f42d1bfea294121

Tree: 1ccb4bb53e34990e6fffe5a9049907536eacb347

Author: Shiven Garia

Committer: GitHub

## Message

```
edit_prediction: Fix special token check matching `=======` inside comments (#52510)

Closes #52489

The special token check in `prompt_input_contains_special_tokens` used
`String::contains()` to look for `=======\n` in the buffer. This meant
any line containing `=======` (like `// =======` section separators)
would cause edit predictions to bail out entirely.

Fixed by only matching when the token appears at the start of a line,
since the git merge markers are always placed at line boundaries in the
prompt.

Added tests for both the helper function and a regression test for the
reported issue.

---------

Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>
```

## Parents

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

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