From 4aed32d1527fb49212bb10ca395568c0f8b564bf Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 12 Jan 2014 16:26:31 +0000 Subject: [PATCH] Store timestamp of last content modification in buffer lines That means that lines that move around keep their timestamp. --- src/buffer.cc | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/buffer.cc b/src/buffer.cc index 2fb1a46c..0e59e36f 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -540,11 +540,6 @@ BufferCoord Buffer::do_insert(BufferCoord pos, const String& content) auto line_it = m_lines.begin() + (int)pos.line; *line_it = std::move(*new_lines.begin()); - if (new_lines.size() > 1) - { - for (auto it = line_it + 1; it != m_lines.end(); ++it) - it->timestamp = m_timestamp; - } m_lines.insert(line_it+1, std::make_move_iterator(new_lines.begin() + 1), std::make_move_iterator(new_lines.end())); @@ -584,13 +579,6 @@ BufferCoord Buffer::do_erase(BufferCoord begin, BufferCoord end) for (LineCount i = begin.line+1; i < line_count(); ++i) m_lines[i].start -= length; - // all following lines have conceptually changed if we removed a line - if (begin.line != end.line) - { - for (LineCount i = begin.line; i < line_count(); ++i) - m_lines[i].timestamp = m_timestamp; - } - for (auto listener : m_change_listeners) listener->on_erase(*this, begin, end); return next;