1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-19 17:31:44 +03:00

Fix Buffer::offset_coord that was dropping the target coordinate

This commit is contained in:
Maxime Coste 2017-02-07 23:13:14 +00:00
parent 5342d67fa4
commit 1c63d28f15

View File

@ -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