update for new vte_terminal_select_text API

This commit is contained in:
Daniel Micay 2012-07-09 22:27:17 -04:00
parent b9ea216495
commit 66f0ef35aa
1 changed files with 5 additions and 7 deletions

View File

@ -83,7 +83,7 @@ static void update_selection(VteTerminal *vte, const select_info *select) {
if (select->mode == SELECT_ON) { if (select->mode == SELECT_ON) {
// a hack to use the selection as a cursor until a real one is implemented // a hack to use the selection as a cursor until a real one is implemented
vte_terminal_select_text(vte, select->cursor_col, select->cursor_row, vte_terminal_select_text(vte, select->cursor_col, select->cursor_row,
select->cursor_col, select->cursor_row, 0, 0); select->cursor_col, select->cursor_row);
return; // not in visual mode return; // not in visual mode
} }
@ -97,24 +97,22 @@ static void update_selection(VteTerminal *vte, const select_info *select) {
const long end = select->cursor_row * n_columns + select->cursor_col; const long end = select->cursor_row * n_columns + select->cursor_col;
if (begin < end) { if (begin < end) {
vte_terminal_select_text(vte, select->begin_col, select->begin_row, vte_terminal_select_text(vte, select->begin_col, select->begin_row,
select->cursor_col, select->cursor_row, 0, 0); select->cursor_col, select->cursor_row);
} else { } else {
vte_terminal_select_text(vte, select->cursor_col, select->cursor_row, vte_terminal_select_text(vte, select->cursor_col, select->cursor_row,
select->begin_col, select->begin_row, 0, 0); select->begin_col, select->begin_row);
} }
} else if (select->mode == SELECT_VISUAL_LINE) { } else if (select->mode == SELECT_VISUAL_LINE) {
vte_terminal_select_text(vte, 0, vte_terminal_select_text(vte, 0,
MIN(select->begin_row, select->cursor_row), MIN(select->begin_row, select->cursor_row),
n_columns - 1, n_columns - 1,
MAX(select->begin_row, select->cursor_row), MAX(select->begin_row, select->cursor_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, select->cursor_col), MIN(select->begin_col, select->cursor_col),
MIN(select->begin_row, select->cursor_row), MIN(select->begin_row, select->cursor_row),
MAX(select->begin_col, select->cursor_col), MAX(select->begin_col, select->cursor_col),
MAX(select->begin_row, select->cursor_row), MAX(select->begin_row, select->cursor_row));
0, 0);
} }
vte_terminal_copy_primary(vte); vte_terminal_copy_primary(vte);