From 75ae172ba228e904f5d13319dcdeb1dcf17639d9 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Fri, 20 Mar 2020 14:05:26 +0100 Subject: [PATCH] token search: replace only until the end of the token Fixes #6774 --- src/reader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reader.cpp b/src/reader.cpp index a0ab4eb47..a35bd2f51 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -2007,7 +2007,7 @@ void reader_data_t::replace_current_token(wcstring &&new_token) { if (!begin || !end) return; size_t offset = begin - buff; - size_t length = end - buff; + size_t length = end - begin; el->replace_substring(offset, length, std::move(new_token)); }