Allow l/h to cross line boundaries
l and h are now respectively "next character" and "previous character"
This commit is contained in:
parent
6a6e71dc0f
commit
2a60af25dc
|
@ -194,9 +194,7 @@ BufferCoord Buffer::clamp(BufferCoord coord) const
|
||||||
|
|
||||||
BufferCoord Buffer::offset_coord(BufferCoord coord, CharCount offset, ColumnCount, bool)
|
BufferCoord Buffer::offset_coord(BufferCoord coord, CharCount offset, ColumnCount, bool)
|
||||||
{
|
{
|
||||||
StringView line = m_lines[coord.line];
|
return utf8::advance(iterator_at(coord), offset < 0 ? begin() : end()-1, offset).coord();
|
||||||
auto target = utf8::advance(&line[coord.column], offset < 0 ? line.begin() : line.end()-1, offset);
|
|
||||||
return {coord.line, (int)(target - line.begin())};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user