[vte/vte-0-36] widget: Maintain selection when rewrapping, take 2



commit 335872efdf8bdd40efceaf306fa25b7ba8ad5725
Author: Egmont Koblinger <egmont gmail com>
Date:   Fri Jan 24 01:34:18 2014 +0100

    widget: Maintain selection when rewrapping, take 2
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722635#c7

 src/vte.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index f2265d2..e0d9c93 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -6986,7 +6986,7 @@ vte_terminal_extend_selection(VteTerminal *terminal, long x, long y,
        height = terminal->char_height;
        width = terminal->char_width;
 
-       /* Confine y into the visible area. (#563024) */
+       /* Confine coordinates into the visible area. (#563024, #722635c7) */
        if (y < 0) {
                y = 0;
                if (!terminal->pvt->selection_block_mode)
@@ -6999,6 +6999,11 @@ vte_terminal_extend_selection(VteTerminal *terminal, long x, long y,
                        y = terminal->row_count * height - 1;
                }
        }
+       if (x < 0) {
+               x = 0;
+       } else if (x >= terminal->column_count * width) {
+               x = terminal->column_count * width - 1;
+       }
 
        screen = terminal->pvt->screen;
        old_start = terminal->pvt->selection_start;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]