From 030450838a532ad052b54449222f08f80ca78604 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 22 Feb 2012 21:49:00 +0000 Subject: [PATCH] fix Buffer::line_length for last line --- src/buffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buffer.cc b/src/buffer.cc index d5cb762c..bbd8c762 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -76,7 +76,7 @@ BufferSize Buffer::line_length(BufferPos line) const { assert(not m_lines.empty()); BufferPos end = (line >= line_count() - 1) ? - m_content.size() - 1 : m_lines[line + 1] - 1; + m_content.size() : m_lines[line + 1] - 1; return end - m_lines[line]; }