diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-02-07 23:13:14 +0000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-02-07 23:13:14 +0000 |
| commit | 1c63d28f15012d6ba09580013071afbf21e1f0ec (patch) | |
| tree | 28e634c948d133782bc34f1dfab2347e096e9c73 /src/buffer.cc | |
| parent | 5342d67fa4eb5ce22e5d40c61a0db6bbb5fc52fd (diff) | |
Fix Buffer::offset_coord that was dropping the target coordinate
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 1fa837cc..e02720ca 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -187,8 +187,8 @@ BufferCoordAndTarget Buffer::offset_coord(BufferCoordAndTarget coord, LineCount auto line = Kakoune::clamp(coord.line + offset, 0_line, line_count()-1); StringView content = m_lines[line]; - column = std::max(0_col, std::min(column, content.column_length() - 2)); - return {line, content.byte_count_to(column), column}; + auto final_column = std::max(0_col, std::min(column, content.column_length() - 2)); + return {line, content.byte_count_to(final_column), column}; } String Buffer::string(BufferCoord begin, BufferCoord end) const |
