Fix Buffer::offset_coord that was dropping the target coordinate
This commit is contained in:
parent
5342d67fa4
commit
1c63d28f15
|
@ -187,8 +187,8 @@ BufferCoordAndTarget Buffer::offset_coord(BufferCoordAndTarget coord, LineCount
|
||||||
auto line = Kakoune::clamp(coord.line + offset, 0_line, line_count()-1);
|
auto line = Kakoune::clamp(coord.line + offset, 0_line, line_count()-1);
|
||||||
StringView content = m_lines[line];
|
StringView content = m_lines[line];
|
||||||
|
|
||||||
column = std::max(0_col, std::min(column, content.column_length() - 2));
|
auto final_column = std::max(0_col, std::min(column, content.column_length() - 2));
|
||||||
return {line, content.byte_count_to(column), column};
|
return {line, content.byte_count_to(final_column), column};
|
||||||
}
|
}
|
||||||
|
|
||||||
String Buffer::string(BufferCoord begin, BufferCoord end) const
|
String Buffer::string(BufferCoord begin, BufferCoord end) const
|
||||||
|
|
Loading…
Reference in New Issue
Block a user