From 68bdbf9a7f702a8c9e942e15305c769b9aa9c9a8 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 9 Jan 2006 19:01:56 +0000 Subject: [PATCH] *** empty log message *** --- src/rxvtlib.h.in | 3 +-- src/screen.C | 15 +++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/rxvtlib.h.in b/src/rxvtlib.h.in index 54a9f26a..0776c18a 100644 --- a/src/rxvtlib.h.in +++ b/src/rxvtlib.h.in @@ -256,9 +256,8 @@ struct rxvt_vars : TermWin_t { int sb_shadow; /* scrollbar shadow width */ rxvt_ptytty pty; int numlock_state; - line_t *row_buf; // all lines, scrollback + terminal, circular + line_t *row_buf; // all lines, scrollback + terminal, circular, followed by temp_buf line_t *drawn_buf; // text on screen - line_t *temp_buf; // temporary buffer line_t *swap_buf; // lines for swap buffer char *tabs; /* per location: 1 == tab-stop */ screen_t screen; diff --git a/src/screen.C b/src/screen.C index 9f1183ec..9835ff22 100644 --- a/src/screen.C +++ b/src/screen.C @@ -196,7 +196,6 @@ rxvt_term::scr_reset () { /* * first time called so just malloc everything: don't rely on realloc - * Note: this is still needed so that all the scrollback lines are NULL */ nsaved = 0; /* no saved lines */ term_start = 0; @@ -204,10 +203,9 @@ rxvt_term::scr_reset () talloc = new rxvt_salloc (ncol * sizeof (text_t)); ralloc = new rxvt_salloc (ncol * sizeof (rend_t)); - row_buf = (line_t *)rxvt_calloc (total_rows, sizeof (line_t)); - temp_buf = (line_t *)rxvt_calloc (total_rows, sizeof (line_t)); - drawn_buf = (line_t *)rxvt_calloc (nrow , sizeof (line_t)); - swap_buf = (line_t *)rxvt_calloc (nrow , sizeof (line_t)); + row_buf = (line_t *)rxvt_calloc (total_rows + nrow, sizeof (line_t)); + drawn_buf = (line_t *)rxvt_calloc (nrow , sizeof (line_t)); + swap_buf = (line_t *)rxvt_calloc (nrow , sizeof (line_t)); for (int row = nrow; row--; ) { @@ -262,7 +260,6 @@ rxvt_term::scr_reset () #endif drawn_buf = (line_t *)rxvt_realloc (drawn_buf, nrow * sizeof (line_t)); - temp_buf = (line_t *)rxvt_realloc (temp_buf , nrow * sizeof (line_t)); swap_buf = (line_t *)rxvt_realloc (swap_buf , nrow * sizeof (line_t)); for (int row = min (nrow, prev_nrow); row--; ) @@ -277,7 +274,8 @@ rxvt_term::scr_reset () drawn_buf[row].clear (); scr_blank_screen_mem (drawn_buf[row], DEFAULT_RSTYLE); } - line_t *old_buf = row_buf; row_buf = (line_t *)rxvt_calloc (total_rows, sizeof (line_t)); + line_t *old_buf = row_buf; + row_buf = (line_t *)rxvt_calloc (total_rows + nrow, sizeof (line_t)); int p = MOD (term_start + prev_nrow, prev_total_rows); // previous row int pend = MOD (term_start - nsaved , prev_total_rows); @@ -435,7 +433,6 @@ rxvt_term::scr_release () free (row_buf); free (swap_buf); free (drawn_buf); - free (temp_buf); free (tabs); row_buf = 0; // signal that we freed all the arrays @@ -691,6 +688,8 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count) min_it (count, rows); + line_t *temp_buf = row_buf + total_rows; + for (int row = 0; row < rows; row++) { temp_buf [row] = ROW(row1 + (row + count + rows) % rows); -- 2.34.1