Fix off-by-one when iterating over selections that stretch into the history buf

Fixes #295
This commit is contained in:
Kovid Goyal 2018-01-25 20:50:34 +05:30
parent 627b91ffba
commit 1603310b86
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1298,7 +1298,7 @@ visual_line_(Screen *self, index_type y) {
static inline Line*
range_line_(Screen *self, int y) {
if (y < 0) {
historybuf_init_line(self->historybuf, -y, self->historybuf->line);
historybuf_init_line(self->historybuf, -(y + 1), self->historybuf->line);
return self->historybuf->line;
}
linebuf_init_line(self->linebuf, y);