simplify visual block mode selection

This commit is contained in:
Daniel Micay 2012-07-08 01:12:26 -04:00
parent 7d5229d6c8
commit 711fc059e4
1 changed files with 6 additions and 7 deletions

View File

@ -111,13 +111,12 @@ static void cursor_moved_cb(VteTerminal *vte, select_info *select) {
n_columns - 1, select->begin_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) {
if (begin < end) { vte_terminal_select_text(vte,
vte_terminal_select_text(vte, MIN(select->begin_col, end_col), select->begin_row, MIN(select->begin_col, end_col),
MAX(select->begin_col, end_col), end_row, 0, 0); MIN(select->begin_row, end_row),
} else { MAX(select->begin_col, end_col),
vte_terminal_select_text(vte, MIN(select->begin_col, end_col), end_row, MAX(select->begin_row, end_row),
MAX(select->begin_col, end_col), select->begin_row, 0, 0); 0, 0);
}
} }
vte_terminal_copy_primary(vte); vte_terminal_copy_primary(vte);