From 711fc059e41f162e9d242872e1d5340f068c1376 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 8 Jul 2012 01:12:26 -0400 Subject: [PATCH] simplify visual block mode selection --- termite.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/termite.c b/termite.c index 6f5d2ba..7146744 100644 --- a/termite.c +++ b/termite.c @@ -111,13 +111,12 @@ static void cursor_moved_cb(VteTerminal *vte, select_info *select) { n_columns - 1, select->begin_row, 0, 0); } } else if (select->mode == SELECT_VISUAL_BLOCK) { - if (begin < end) { - vte_terminal_select_text(vte, MIN(select->begin_col, end_col), select->begin_row, - MAX(select->begin_col, end_col), end_row, 0, 0); - } else { - vte_terminal_select_text(vte, MIN(select->begin_col, end_col), end_row, - MAX(select->begin_col, end_col), select->begin_row, 0, 0); - } + vte_terminal_select_text(vte, + MIN(select->begin_col, end_col), + MIN(select->begin_row, end_row), + MAX(select->begin_col, end_col), + MAX(select->begin_row, end_row), + 0, 0); } vte_terminal_copy_primary(vte);