diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-03-30 12:00:40 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-03-30 12:00:40 +0000 |
| commit | 2e7cd2233ce449a51756c180432635eb1aee20f3 (patch) | |
| tree | 965fefc94343f7b554da9135bf9024aad21b4744 /src/buffer.cc | |
| parent | 0ba7c7286dd97d7d3d7c03bccf3ea98389f0e273 (diff) | |
add a Line::length method
Diffstat (limited to 'src/buffer.cc')
| -rw-r--r-- | src/buffer.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/buffer.cc b/src/buffer.cc index 75416712..1c37e2f2 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -100,14 +100,14 @@ BufferIterator Buffer::end() const { if (m_lines.empty()) return BufferIterator(*this, { 0, 0 }); - return BufferIterator(*this, { (int)line_count()-1, (int)m_lines.back().content.length() }); + return BufferIterator(*this, { (int)line_count()-1, (int)m_lines.back().length() }); } BufferSize Buffer::length() const { if (m_lines.empty()) return 0; - return m_lines.back().start + m_lines.back().content.length(); + return m_lines.back().start + m_lines.back().length(); } BufferSize Buffer::line_count() const @@ -190,7 +190,7 @@ void Buffer::check_invariant() const for (auto& line : m_lines) { assert(line.start == start); - start += line.content.length(); + start += line.length(); } } |
