diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-08-15 17:07:53 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-08-15 17:07:53 +0200 |
| commit | 5393e9e78b673bcfeb75ee4e2262aaae294e73ee (patch) | |
| tree | 2f85c785e959f7d8602ecf39559e8e0ec107e893 /src/buffer.cc | |
| parent | 14475e91cbc47a6dbff15cb6393d0da99f404a1f (diff) | |
Buffer: add a timestamp
Diffstat (limited to 'src/buffer.cc')
| -rw-r--r-- | src/buffer.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/buffer.cc b/src/buffer.cc index 7c643dd5..8cec62d2 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -26,6 +26,7 @@ Buffer::Buffer(String name, Type type, : m_name(std::move(name)), m_type(type), m_history(1), m_history_cursor(m_history.begin()), m_last_save_undo_index(0), + m_timestamp(0), m_hook_manager(GlobalHookManager::instance()), m_option_manager(GlobalOptionManager::instance()) { @@ -233,6 +234,7 @@ void Buffer::check_invariant() const void Buffer::do_insert(const BufferIterator& pos, const String& content) { + ++m_timestamp; BufferSize offset = pos.offset(); // all following lines advanced by length @@ -307,6 +309,7 @@ void Buffer::do_insert(const BufferIterator& pos, const String& content) void Buffer::do_erase(const BufferIterator& pos, BufferSize length) { + ++m_timestamp; BufferIterator end = pos + length; assert(end.is_valid()); String prefix = m_lines[pos.line()].content.substr(0, pos.column()); |
