summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgmont Koblinger <egmont@gmail.com>2015-01-18 17:51:07 +0100
committerEgmont Koblinger <egmont@gmail.com>2015-01-18 17:51:07 +0100
commitc632c336a5cdca8ea3f1856973a359431b61136a (patch)
treecf01b5a5387e87eab6a914d1198c55d8306904b4
parentc18db6cae7f5d8d8f70c5c0c589243f8d29fad0e (diff)
downloadvte-c632c336a5cdca8ea3f1856973a359431b61136a.tar.gz
widget: Modify selection boundaries to match xterm's behavior
https://bugzilla.gnome.org/show_bug.cgi?id=725909
-rw-r--r--src/vte.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/vte.c b/src/vte.c
index 3da2807b..b63c7455 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -6449,24 +6449,21 @@ vte_terminal_extend_selection_expand (VteTerminal *terminal)
if (cell->attr.fragment || cell->c != 0)
break;
}
- /* If the start point is to its right, then move the
- * startpoint up to the beginning of the next line
- * unless that would move the startpoint after the end
- * point, or we're in select-by-line mode. */
- if ((sc->col >= i) &&
- (terminal->pvt->selection_type != selection_type_line)) {
- if (sc->row < ec->row) {
- sc->col = 0;
- sc->row++;
- } else {
- sc->col = i;
- }
- }
} else {
- /* Snap to the leftmost column. */
- sc->col = 0;
- }
- sc->col = find_start_column (terminal, sc->col, sc->row);
+ i = 0;
+ }
+ if (sc->col > i) {
+ if (terminal->pvt->selection_type == selection_type_char) {
+ /* If the start point is neither over the used cells, nor over the first
+ * unused one, then move it to the next line. This way you can still start
+ * selecting at the newline character by clicking over the first unused cell.
+ * See bug 725909. */
+ sc->col = -1;
+ sc->row++;
+ } else if (terminal->pvt->selection_type == selection_type_word) {
+ sc->col = i;
+ }
+ }
/* Handle end-of-line at the end-cell. */
rowdata = _vte_terminal_find_row_data(terminal, ec->row);