ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/screen.C
(Generate patch)

Comparing rxvt-unicode/src/screen.C (file contents):
Revision 1.216 by root, Mon Jan 9 18:51:19 2006 UTC vs.
Revision 1.217 by root, Mon Jan 9 19:01:56 2006 UTC

194 194
195 if (!row_buf) 195 if (!row_buf)
196 { 196 {
197 /* 197 /*
198 * first time called so just malloc everything: don't rely on realloc 198 * first time called so just malloc everything: don't rely on realloc
199 * Note: this is still needed so that all the scrollback lines are NULL
200 */ 199 */
201 nsaved = 0; /* no saved lines */ 200 nsaved = 0; /* no saved lines */
202 term_start = 0; 201 term_start = 0;
203 202
204 talloc = new rxvt_salloc (ncol * sizeof (text_t)); 203 talloc = new rxvt_salloc (ncol * sizeof (text_t));
205 ralloc = new rxvt_salloc (ncol * sizeof (rend_t)); 204 ralloc = new rxvt_salloc (ncol * sizeof (rend_t));
206 205
207 row_buf = (line_t *)rxvt_calloc (total_rows, sizeof (line_t)); 206 row_buf = (line_t *)rxvt_calloc (total_rows + nrow, sizeof (line_t));
208 temp_buf = (line_t *)rxvt_calloc (total_rows, sizeof (line_t));
209 drawn_buf = (line_t *)rxvt_calloc (nrow , sizeof (line_t)); 207 drawn_buf = (line_t *)rxvt_calloc (nrow , sizeof (line_t));
210 swap_buf = (line_t *)rxvt_calloc (nrow , sizeof (line_t)); 208 swap_buf = (line_t *)rxvt_calloc (nrow , sizeof (line_t));
211 209
212 for (int row = nrow; row--; ) 210 for (int row = nrow; row--; )
213 { 211 {
214 scr_blank_screen_mem (ROW (row), DEFAULT_RSTYLE); 212 scr_blank_screen_mem (ROW (row), DEFAULT_RSTYLE);
215 scr_blank_screen_mem (swap_buf [row], DEFAULT_RSTYLE); 213 scr_blank_screen_mem (swap_buf [row], DEFAULT_RSTYLE);
260 } 258 }
261 } 259 }
262#endif 260#endif
263 261
264 drawn_buf = (line_t *)rxvt_realloc (drawn_buf, nrow * sizeof (line_t)); 262 drawn_buf = (line_t *)rxvt_realloc (drawn_buf, nrow * sizeof (line_t));
265 temp_buf = (line_t *)rxvt_realloc (temp_buf , nrow * sizeof (line_t));
266 swap_buf = (line_t *)rxvt_realloc (swap_buf , nrow * sizeof (line_t)); 263 swap_buf = (line_t *)rxvt_realloc (swap_buf , nrow * sizeof (line_t));
267 264
268 for (int row = min (nrow, prev_nrow); row--; ) 265 for (int row = min (nrow, prev_nrow); row--; )
269 { 266 {
270 lresize (drawn_buf[row]); 267 lresize (drawn_buf[row]);
275 { 272 {
276 swap_buf [row].clear (); scr_blank_screen_mem (swap_buf [row], DEFAULT_RSTYLE); 273 swap_buf [row].clear (); scr_blank_screen_mem (swap_buf [row], DEFAULT_RSTYLE);
277 drawn_buf[row].clear (); scr_blank_screen_mem (drawn_buf[row], DEFAULT_RSTYLE); 274 drawn_buf[row].clear (); scr_blank_screen_mem (drawn_buf[row], DEFAULT_RSTYLE);
278 } 275 }
279 276
277 line_t *old_buf = row_buf;
280 line_t *old_buf = row_buf; row_buf = (line_t *)rxvt_calloc (total_rows, sizeof (line_t)); 278 row_buf = (line_t *)rxvt_calloc (total_rows + nrow, sizeof (line_t));
281 279
282 int p = MOD (term_start + prev_nrow, prev_total_rows); // previous row 280 int p = MOD (term_start + prev_nrow, prev_total_rows); // previous row
283 int pend = MOD (term_start - nsaved , prev_total_rows); 281 int pend = MOD (term_start - nsaved , prev_total_rows);
284 int q = total_rows; // rewrapped row 282 int q = total_rows; // rewrapped row
285 283
433 delete ralloc; ralloc = 0; 431 delete ralloc; ralloc = 0;
434 432
435 free (row_buf); 433 free (row_buf);
436 free (swap_buf); 434 free (swap_buf);
437 free (drawn_buf); 435 free (drawn_buf);
438 free (temp_buf);
439 free (tabs); 436 free (tabs);
440 437
441 row_buf = 0; // signal that we freed all the arrays 438 row_buf = 0; // signal that we freed all the arrays
442} 439}
443 440
688 // part of scr_scroll_text is not time-critical. 685 // part of scr_scroll_text is not time-critical.
689 686
690 int rows = row2 - row1 + 1; 687 int rows = row2 - row1 + 1;
691 688
692 min_it (count, rows); 689 min_it (count, rows);
690
691 line_t *temp_buf = row_buf + total_rows;
693 692
694 for (int row = 0; row < rows; row++) 693 for (int row = 0; row < rows; row++)
695 { 694 {
696 temp_buf [row] = ROW(row1 + (row + count + rows) % rows); 695 temp_buf [row] = ROW(row1 + (row + count + rows) % rows);
697 696

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines