[vte/vte-0-44] terminal: Fix ::get_text start column not to be negative



commit 6f2304c4355521b5d1729d880adba33ad80b92f7
Author: Christian Persch <chpe gnome org>
Date:   Sun May 8 08:59:09 2016 +0200

    terminal: Fix ::get_text start column not to be negative
    
    When the selection starts at the beginning of the line but
    having been done by starting on the preceding line after the
    end of text, the start column is -1, which would cause
    ::get_text() to lose the first line of the selected text.
    Regression from commit 3696348c0b9c7d60caf7302411ec4c0298f56e57.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765276
    (cherry picked from commit d005d622f458f259919b35e448a985e2aabc7ecd)

 src/vte.cc |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 5ba70d3..d8f27cc 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -6020,6 +6020,9 @@ VteTerminalPrivate::get_text(vte::grid::row_t start_row,
        string = g_string_new(NULL);
        memset(&attr, 0, sizeof(attr));
 
+        if (start_col < 0)
+                start_col = 0;
+
         vte::grid::column_t next_first_column = block ? start_col : 0;
         vte::grid::column_t col = start_col;
         vte::grid::row_t row;


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