[vte/vte-0-36] emulation: Fix restricted scrolling with a short ring
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-0-36] emulation: Fix restricted scrolling with a short ring
- Date: Mon, 18 Nov 2013 18:53:24 +0000 (UTC)
commit 98b54527c802620a5951a615fe6ae21ffc19a171
Author: Egmont Koblinger <egmont gmail com>
Date: Tue Oct 22 23:56:05 2013 +0200
emulation: Fix restricted scrolling with a short ring
Fixes setting restrict scrolling with the upper bound being row 1 not working.
To test, run "echo -e '\e[1;15r'" immediately before the terminal starts
scrolling; before this patch this had no effect.
https://bugzilla.gnome.org/show_bug.cgi?id=710483
src/vteseq.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/vteseq.c b/src/vteseq.c
index fad4d46..2ccd58e 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -1303,10 +1303,14 @@ vte_sequence_handler_cs (VteTerminal *terminal, GValueArray *params)
screen->scrolling_region.start = start;
screen->scrolling_region.end = end;
screen->scrolling_restricted = TRUE;
- /* Special case -- run wild, run free. */
if (screen->scrolling_region.start == 0 &&
screen->scrolling_region.end == rows - 1) {
+ /* Special case -- run wild, run free. */
screen->scrolling_restricted = FALSE;
+ } else {
+ /* Maybe extend the ring -- bug 710483 */
+ while (_vte_ring_next(screen->row_data) < screen->insert_delta + rows)
+ _vte_ring_insert(screen->row_data, _vte_ring_next(screen->row_data));
}
}
@@ -1339,11 +1343,15 @@ vte_sequence_handler_cS (VteTerminal *terminal, GValueArray *params)
screen->scrolling_region.start = start;
screen->scrolling_region.end = end;
screen->scrolling_restricted = TRUE;
- /* Special case -- run wild, run free. */
rows = terminal->row_count;
if ((screen->scrolling_region.start == 0) &&
(screen->scrolling_region.end == rows - 1)) {
+ /* Special case -- run wild, run free. */
screen->scrolling_restricted = FALSE;
+ } else {
+ /* Maybe extend the ring -- bug 710483 */
+ while (_vte_ring_next(screen->row_data) < screen->insert_delta + rows)
+ _vte_ring_insert(screen->row_data, _vte_ring_next(screen->row_data));
}
/* Clamp the cursor to the scrolling region. */
screen->cursor_current.row = CLAMP(screen->cursor_current.row,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]