Drawing selection and overlapping selections
This commit is contained in:
@@ -349,6 +349,7 @@ LineAndColumn FindLineAndColumn(Buffer &buffer, int64_t pos) {
|
||||
result.column = 1;
|
||||
result.line = FindLine(buffer, pos);
|
||||
for (BufferIter iter = Iterate(buffer, result.line.range); IsValid(iter); Advance(&iter)) {
|
||||
// @todo: make sure we handle when there is invalid unicode in the stream
|
||||
if (iter.pos == pos) {
|
||||
result.column = iter.codepoint_index;
|
||||
break;
|
||||
@@ -395,7 +396,7 @@ int64_t Seek(Buffer &buffer, int64_t pos, int64_t direction = ITERATE_FORWARD) {
|
||||
bool seek_whitespace = standing_on_whitespace == false;
|
||||
bool seek_word = standing_on_whitespace;
|
||||
|
||||
int64_t result = max;
|
||||
int64_t result = direction == ITERATE_BACKWARD ? 0 : buffer.len;
|
||||
BufferIter iter = Iterate(buffer, {min, max}, direction);
|
||||
int64_t prev_pos = iter.pos;
|
||||
for (; IsValid(iter); Advance(&iter)) {
|
||||
|
||||
Reference in New Issue
Block a user