simplify visual line mode selection

This commit is contained in:
Daniel Micay 2012-07-08 01:15:00 -04:00
parent 711fc059e4
commit 1a21165a48
1 changed files with 5 additions and 7 deletions

View File

@ -103,13 +103,11 @@ static void cursor_moved_cb(VteTerminal *vte, select_info *select) {
select->begin_col, select->begin_row, 0, 0); select->begin_col, select->begin_row, 0, 0);
} }
} else if (select->mode == SELECT_VISUAL_LINE) { } else if (select->mode == SELECT_VISUAL_LINE) {
if (begin < end) { vte_terminal_select_text(vte, 0,
vte_terminal_select_text(vte, 0, select->begin_row, MIN(select->begin_row, end_row),
n_columns - 1, end_row, 0, 0); n_columns - 1,
} else { MAX(select->begin_row, end_row),
vte_terminal_select_text(vte, 0, end_row, 0, 0);
n_columns - 1, select->begin_row, 0, 0);
}
} else if (select->mode == SELECT_VISUAL_BLOCK) { } else if (select->mode == SELECT_VISUAL_BLOCK) {
vte_terminal_select_text(vte, vte_terminal_select_text(vte,
MIN(select->begin_col, end_col), MIN(select->begin_col, end_col),