From 27d31bb5edc1167043fc3412bea5c456a3c8f7e6 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 18 Jul 2017 23:42:21 -0400 Subject: fix some more off by one errors --- src/window-xlib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/window-xlib.c b/src/window-xlib.c index 461733a..b183447 100644 --- a/src/window-xlib.c +++ b/src/window-xlib.c @@ -1224,7 +1224,7 @@ static int runes_window_is_word_char(RunesTerm *t, int row, int col) r = &t->scr->grid->rows[row - 1 + t->scr->grid->row_top]; if (r->wrapped) { prev_row = row - 1; - prev_col = t->scr->grid->max.col; + prev_col = t->scr->grid->max.col - 1; } } @@ -1318,9 +1318,9 @@ static struct vt100_loc runes_window_get_mouse_position( ret.row = ret.row < 0 ? 0 : ret.row > t->scr->grid->max.row - 1 ? t->scr->grid->max.row - 1 : ret.row; - ret.col = ret.col < 0 ? 0 - : ret.col > t->scr->grid->max.col ? t->scr->grid->max.col - : ret.col; + ret.col = ret.col < 0 ? 0 + : ret.col > t->scr->grid->max.col - 1 ? t->scr->grid->max.col - 1 + : ret.col; ret.row = ret.row - t->display->row_visible_offset + t->scr->grid->row_count - t->scr->grid->max.row; -- cgit v1.2.3