diff --git a/src/core/Buffer.cc b/src/core/Buffer.cc index be08f6d..53906df 100644 --- a/src/core/Buffer.cc +++ b/src/core/Buffer.cc @@ -241,11 +241,18 @@ size_t Buffer::lines_in_data(size_t offset, size_t length) void Buffer::post_warp_cursors() { - for (auto cursor : m_cursors) + if (size() > 0u) { - if ((*cursor == *m_eof_iterator) && (size() > 0u)) + for (auto cursor : m_cursors) { - cursor->go_back(); + if (*cursor == *m_eof_iterator) + { + cursor->go_back(); + } + if ((!insert_mode()) && (**cursor == '\n')) + { + cursor->go_left_in_line(); + } } } }