From 3f51feaaef05a8c3a70bfb81c483f1ff7add396c Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 6 Sep 2011 18:33:18 +0000 Subject: Buffer: accept initial content in constructor --- src/buffer.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/buffer.cc') diff --git a/src/buffer.cc b/src/buffer.cc index b7034b5c..ef8e0e1e 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -118,9 +118,11 @@ bool BufferIterator::is_end() const return m_position == m_buffer->length(); } -Buffer::Buffer(const std::string& name) - : m_name(name) +Buffer::Buffer(const std::string& name, const BufferString& initial_content) + : m_name(name), m_history(1), m_history_cursor(m_history.begin()), + m_content(initial_content) { + compute_lines(); } void Buffer::erase(const BufferIterator& begin, const BufferIterator& end) -- cgit v1.2.3