From 560b4ab0b5551091754bcd331d1ac471c077aaab Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 8 Jan 2014 19:34:44 +0000 Subject: [PATCH] Fix DynamicSelectionList selecting buffer end on Buffer::reload --- src/buffer.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/buffer.cc b/src/buffer.cc index 3e510422..7bb30165 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -71,8 +71,10 @@ Buffer::~Buffer() void Buffer::reload(std::vector lines, time_t fs_timestamp) { + // use back coord to simulate the persistance of the last end of line + // as buffers are expected to never be empty. for (auto listener : m_change_listeners) - listener->on_erase(*this, {0,0}, end_coord()); + listener->on_erase(*this, {0,0}, back_coord()); m_history.clear(); m_current_undo_group.clear(); @@ -95,7 +97,7 @@ void Buffer::reload(std::vector lines, time_t fs_timestamp) m_fs_timestamp = fs_timestamp; for (auto listener : m_change_listeners) - listener->on_insert(*this, {0,0}, end_coord()); + listener->on_insert(*this, {0,0}, back_coord()); } String Buffer::display_name() const