fix Buffer::line_length for last line

This commit is contained in:
Maxime Coste 2012-02-22 21:49:00 +00:00
parent 275c0c67d4
commit 030450838a

View File

@ -76,7 +76,7 @@ BufferSize Buffer::line_length(BufferPos line) const
{ {
assert(not m_lines.empty()); assert(not m_lines.empty());
BufferPos end = (line >= line_count() - 1) ? 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]; return end - m_lines[line];
} }