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;
{
/*
* 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;
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--; )
{
#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--; )
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);
free (row_buf);
free (swap_buf);
free (drawn_buf);
- free (temp_buf);
free (tabs);
row_buf = 0; // signal that we freed all the arrays
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);