add some polish to visual mode switching

* switching between visual modes should not reset the begin row/col
* selection should be updated as soon as the mode is switched
This commit is contained in:
Daniel Micay 2012-07-09 03:19:02 -04:00
parent 131cb20584
commit 458087627d
1 changed files with 5 additions and 2 deletions

View File

@ -139,10 +139,13 @@ static void toggle_visual(VteTerminal *vte, select_info *select, select_mode mod
select->mode = SELECT_ON; select->mode = SELECT_ON;
vte_terminal_select_none(vte); vte_terminal_select_none(vte);
} else { } else {
select->mode = mode; if (select->mode == SELECT_ON) {
select->begin_col = select->cursor_col; select->begin_col = select->cursor_col;
select->begin_row = select->cursor_row; select->begin_row = select->cursor_row;
} }
select->mode = mode;
update_selection(vte, select);
}
} }
static void move(VteTerminal *vte, select_info *select, long col, long row) { static void move(VteTerminal *vte, select_info *select, long col, long row) {