From 9412ba117c5b13abd5b2467192ef48873bedd393 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 16 Sep 2014 11:06:18 -0400 Subject: there's not really a purpose to maintain the selection here the terminal can't do anything with it, it's only useful at the x layer --- src/screen.c | 62 ------------------------------------------------------------ 1 file changed, 62 deletions(-) diff --git a/src/screen.c b/src/screen.c index d543b13..66cac51 100644 --- a/src/screen.c +++ b/src/screen.c @@ -11,9 +11,6 @@ static struct vt100_row *vt100_screen_row_at(VT100Screen *vt, int row); static void vt100_screen_scroll_down(VT100Screen *vt, int count); static void vt100_screen_scroll_up(VT100Screen *vt, int count); static int vt100_screen_scroll_region_is_active(VT100Screen *vt); -static int vt100_screen_loc_is_between( - VT100Screen *vt, struct vt100_loc loc, - struct vt100_loc start, struct vt100_loc end); static int vt100_screen_row_max_col(VT100Screen *vt, int row); VT100Screen *vt100_screen_new(int rows, int cols) @@ -110,36 +107,6 @@ int vt100_screen_process_string(VT100Screen *vt, char *buf, size_t len) return len - remaining; } -int vt100_screen_loc_is_selected(VT100Screen *vt, struct vt100_loc loc) -{ - struct vt100_loc start = vt->grid->selection_start; - struct vt100_loc end = vt->grid->selection_end; - - if (!vt->has_selection) { - return 0; - } - - if (loc.row == start.row) { - int start_max_col; - - start_max_col = vt100_screen_row_max_col(vt, start.row); - if (start.col > start_max_col) { - start.col = vt->grid->max.col; - } - } - - if (loc.row == end.row) { - int end_max_col; - - end_max_col = vt100_screen_row_max_col(vt, end.row); - if (end.col > end_max_col) { - end.col = vt->grid->max.col; - } - } - - return vt100_screen_loc_is_between(vt, loc, start, end); -} - void vt100_screen_get_string( VT100Screen *vt, struct vt100_loc *start, struct vt100_loc *end, char **strp, size_t *lenp) @@ -937,35 +904,6 @@ static int vt100_screen_scroll_region_is_active(VT100Screen *vt) || vt->grid->scroll_bottom != vt->grid->max.row - 1; } -static int vt100_screen_loc_is_between( - VT100Screen *vt, struct vt100_loc loc, - struct vt100_loc start, struct vt100_loc end) -{ - UNUSED(vt); - - if (end.row < start.row || (end.row == start.row && end.col < start.col)) { - struct vt100_loc tmp; - - tmp = start; - start = end; - end = tmp; - } - - if (loc.row < start.row || loc.row > end.row) { - return 0; - } - - if (loc.row == start.row && loc.col < start.col) { - return 0; - } - - if (loc.row == end.row && loc.col >= end.col) { - return 0; - } - - return 1; -} - static int vt100_screen_row_max_col(VT100Screen *vt, int row) { struct vt100_cell *cells = vt->grid->rows[row].cells; -- cgit v1.2.3-54-g00ecf