diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-06-05 18:41:02 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-06-06 19:44:07 +0200 |
| commit | 580749a91da1e293c9dc8c5f3a72aa9c5a5e7666 (patch) | |
| tree | b93b4b02550a4765504cb0b14f75f1fa08727976 /src/buffer.cc | |
| parent | 6b667bc803557de2d83cdc5f562c286bb66f86fa (diff) | |
Buffer: remove line_length and replace line_content with operator[]
Diffstat (limited to 'src/buffer.cc')
| -rw-r--r-- | src/buffer.cc | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/buffer.cc b/src/buffer.cc index ae98755b..b9ef6a96 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -91,19 +91,13 @@ BufferIterator Buffer::iterator_at(const BufferCoord& coord) const return is_end(coord) ? end() : BufferIterator(*this, clamp(coord)); } -ByteCount Buffer::line_length(LineCount line) const -{ - kak_assert(line < line_count()); - return m_lines[line].length(); -} - BufferCoord Buffer::clamp(BufferCoord coord) const { if (m_lines.empty()) return BufferCoord{}; coord.line = Kakoune::clamp(coord.line, 0_line, line_count() - 1); - ByteCount max_col = std::max(0_byte, line_length(coord.line) - 1); + ByteCount max_col = std::max(0_byte, m_lines[coord.line].length() - 1); coord.column = Kakoune::clamp(coord.column, 0_byte, max_col); return coord; } |
