token search: replace only until the end of the token

Fixes #6774
This commit is contained in:
Johannes Altmanninger 2020-03-20 14:05:26 +01:00
parent 469e81e01d
commit 75ae172ba2

View file

@ -2007,7 +2007,7 @@ void reader_data_t::replace_current_token(wcstring &&new_token) {
if (!begin || !end) return; if (!begin || !end) return;
size_t offset = begin - buff; size_t offset = begin - buff;
size_t length = end - buff; size_t length = end - begin;
el->replace_substring(offset, length, std::move(new_token)); el->replace_substring(offset, length, std::move(new_token));
} }