[vte/vte-0-38] emulation: Fix vertical positioning after resize in some rare cases



commit 4d01b91e2fd6affda8f13b94401e3c90f6a209e2
Author: Egmont Koblinger <egmont gmail com>
Date:   Mon Mar 30 23:19:46 2015 +0200

    emulation: Fix vertical positioning after resize in some rare cases
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747059
    (cherry picked from commit 41d2e152878cc35d78a4dd8feb7cad52f088cdf9)

 doc/rewrap.txt |   10 +++++-----
 src/vte.c      |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/doc/rewrap.txt b/doc/rewrap.txt
index 35bc2c8..7159248 100644
--- a/doc/rewrap.txt
+++ b/doc/rewrap.txt
@@ -253,14 +253,14 @@ the lines (if necessary) after rewrapping, but before computing the new
 scrollbar offsets, and we drop the highest number of lines that satisfies all
 these three conditions:
 
- - We shouldn't drop more lines than necessary to fit the content without
-   scrollbars.
+ - drop1: We shouldn't drop more lines than necessary to fit the content
+   without scrollbars.
 
- - We should only drop data that's below the cursor's paragraph. (We don't
-   drop data that is under the cursor's row, but belongs to the same
+ - drop2: We should only drop data that's below the cursor's paragraph. (We
+   don't drop data that is under the cursor's row, but belongs to the same
    paragraph).
 
- - We track the character cell that immediately follows the cursor's
+ - drop3: We track the character cell that immediately follows the cursor's
    paragraph (that is, the line after this paragraph, first column), and see
    how much it would get closer to the top of the window (assuming viewport is
    scrolled to the bottom). The original bug is about that the cursor
diff --git a/src/vte.c b/src/vte.c
index 5919416..906d799 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -7665,7 +7665,7 @@ vte_terminal_screen_set_size(VteTerminal *terminal, VteScreen *screen, glong old
                screen->insert_delta = _vte_ring_next(ring) - terminal->pvt->row_count;
                new_top_lines = below_current_paragraph.row - screen->insert_delta;
                drop1 = _vte_ring_length(ring) - terminal->pvt->row_count;
-               drop2 = _vte_ring_length(ring) - below_current_paragraph.row;
+               drop2 = _vte_ring_next(ring) - below_current_paragraph.row;
                drop3 = old_top_lines - new_top_lines;
                drop = MIN(MIN(drop1, drop2), drop3);
                if (drop > 0) {


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