diff options
| author | Maxime Coste <mawww@kakoune.org> | 2019-11-10 12:03:34 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2019-11-10 12:03:34 +1100 |
| commit | e74fba928993ecd6502215ccfe5aaa8d58de7a30 (patch) | |
| tree | c4702042bdba828a34644c48a8fcff953f478986 /src/buffer.cc | |
| parent | 1713d1db7acab3a058939550588c051686638045 (diff) | |
| parent | 87e5a2f512a37b0b4a9f1a5700b0f54424e48f26 (diff) | |
Merge remote-tracking branch 'eraserhd/cppcheck'
Diffstat (limited to 'src/buffer.cc')
| -rw-r--r-- | src/buffer.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buffer.cc b/src/buffer.cc index 60dd5ba9..6088c8a8 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -195,12 +195,12 @@ BufferCoord Buffer::clamp(BufferCoord coord) const return coord; } -BufferCoord Buffer::offset_coord(BufferCoord coord, CharCount offset, ColumnCount, bool) +BufferCoord Buffer::offset_coord(BufferCoord coord, CharCount offset, ColumnCount, bool) const { return utf8::advance(iterator_at(coord), offset < 0 ? begin() : end()-1, offset).coord(); } -BufferCoordAndTarget Buffer::offset_coord(BufferCoordAndTarget coord, LineCount offset, ColumnCount tabstop, bool avoid_eol) +BufferCoordAndTarget Buffer::offset_coord(BufferCoordAndTarget coord, LineCount offset, ColumnCount tabstop, bool avoid_eol) const { const auto column = coord.target == -1 ? get_column(*this, tabstop, coord) : coord.target; const auto line = Kakoune::clamp(coord.line + offset, 0_line, line_count()-1); |
