summaryrefslogtreecommitdiff
path: root/src/buffer.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-01-12 16:26:31 +0000
committerMaxime Coste <frrrwww@gmail.com>2014-01-12 16:26:31 +0000
commit4aed32d1527fb49212bb10ca395568c0f8b564bf (patch)
treeb774c7666f65737c7fea25c28fe67eaa36b1be43 /src/buffer.cc
parentba5b21d43e5a3d3f90878c816965d749cac8a2d2 (diff)
Store timestamp of last content modification in buffer lines
That means that lines that move around keep their timestamp.
Diffstat (limited to 'src/buffer.cc')
-rw-r--r--src/buffer.cc12
1 files changed, 0 insertions, 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;