From aa0cc3b7e306ee064de2929675228b0771ec11b7 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Fri, 7 Sep 2012 18:55:01 -0400 Subject: [PATCH] update_selection always removes the old selection --- termite.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/termite.cc b/termite.cc index 9add25c..39b375c 100644 --- a/termite.cc +++ b/termite.cc @@ -78,19 +78,18 @@ void launch_browser(char *url) { } static void update_selection(VteTerminal *vte, const select_info *select) { + vte_terminal_select_none(vte); + if (select->mode == vi_mode::command) { - vte_terminal_select_none(vte); return; // not in visual mode } + const long n_columns = vte_terminal_get_column_count(vte); long cursor_col, cursor_row; vte_terminal_get_cursor_position(vte, &cursor_col, &cursor_row); - vte_terminal_select_none(vte); vte_terminal_set_selection_block_mode(vte, select->mode == vi_mode::visual_block); - const long n_columns = vte_terminal_get_column_count(vte); - if (select->mode == vi_mode::visual) { const long begin = select->begin_row * n_columns + select->begin_col; const long end = cursor_row * n_columns + cursor_col;