From ac6171686d1ec71dd4452bdf0045d8afd97556ec Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 21 Nov 2012 13:37:36 +0100 Subject: [PATCH] minor fixes to buffer constructor --- src/buffer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/buffer.cc b/src/buffer.cc index 6d3fb11c..3e6eb6e7 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -15,14 +15,14 @@ namespace Kakoune Buffer::Buffer(String name, Flags flags, String initial_content) : m_name(std::move(name)), m_flags(flags), - m_history(1), m_history_cursor(m_history.begin()), + m_history(), 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()) { BufferManager::instance().register_buffer(*this); - if (initial_content.back() != '\n') + if (initial_content.empty() or initial_content.back() != '\n') initial_content += '\n'; do_insert(begin(), std::move(initial_content));