update for new vte_terminal_select_text API
This commit is contained in:
parent
b9ea216495
commit
66f0ef35aa
12
termite.c
12
termite.c
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue