1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-21 10:40:53 +03:00

Window: fix buffer_coord when a line buffer range is empty

Fixes #1711
This commit is contained in:
Maxime Coste 2017-11-24 16:36:37 +08:00
parent 74b0c98769
commit 5a0332ac87

View File

@ -260,7 +260,8 @@ BufferCoord find_buffer_coord(const DisplayLine& line, const Buffer& buffer,
}
column -= len;
}
return buffer.clamp(buffer.prev(range.end));
return range.end == BufferCoord{0,0} ?
range.end : buffer.prev(range.end);
}
}