From 0b4ecef2d2cbef9f22d5fac5f50bbab96b9f9256 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 31 Jan 2015 23:50:24 +0000 Subject: Rewrite line modifications, hopefully with easier to comprehend code --- src/word_db.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/word_db.cc') diff --git a/src/word_db.cc b/src/word_db.cc index 6b0eeb0a..2786396b 100644 --- a/src/word_db.cc +++ b/src/word_db.cc @@ -108,13 +108,13 @@ void WordDB::update_db() kak_assert((int)new_lines.size() == (int)modif.new_line); - while (old_line <= modif.old_line + modif.num_removed) + while (old_line < modif.old_line + modif.num_removed) { kak_assert(old_line < m_lines.size()); remove_words(get_words(SharedString{m_lines[(int)old_line++]})); } - for (auto l = 0_line; l <= modif.num_added; ++l) + for (auto l = 0_line; l < modif.num_added; ++l) { if (modif.new_line + l >= buffer.line_count()) break; -- cgit v1.2.3