--- rxvt-unicode/src/screen.C 2021/05/13 19:40:20 1.460 +++ rxvt-unicode/src/screen.C 2022/08/08 09:47:56 1.468 @@ -109,7 +109,7 @@ l.touch (); efs &= ~RS_baseattrMask; // remove italic etc. fontstyles - efs = SET_FONT (efs, FONTSET (efs)->find_font (' ')); + efs = SET_FONT (efs, FONTSET (efs)->find_space_font ()); text_t *et = l.t + col; rend_t *er = l.r + col; @@ -141,7 +141,7 @@ col--; rend_t rend = l.r[col] & ~RS_baseattrMask; - rend = SET_FONT (rend, FONTSET (rend)->find_font (' ')); + rend = SET_FONT (rend, FONTSET (rend)->find_space_font ()); l.touch (); @@ -293,6 +293,7 @@ int common_col = min (prev_ncol, ncol); + // resize swap_buf, blank drawn_buf for (int row = min (nrow, prev_nrow); row--; ) { scr_blank_screen_mem (drawn_buf [row], DEFAULT_RSTYLE); @@ -306,7 +307,8 @@ int pend = MOD (term_start + top_row , prev_total_rows); int q = total_rows; // rewrapped row - if (top_row) +#if ENABLE_FRILLS + if ((rewrap_always || top_row) && !rewrap_never) { // Re-wrap lines. This is rather ugly, possibly because I am too dumb // to come up with a lean and mean algorithm. @@ -396,27 +398,27 @@ scr_blank_screen_mem (ROW (--top_row), DEFAULT_RSTYLE); } else +#endif { - // if no scrollback exists (yet), wing, instead of wrap - - for (int row = min (nrow, prev_nrow); row--; ) + // wing, instead of wrap + do { - line_t &src = prev_row_buf [MOD (term_start + row, prev_total_rows)]; - line_t &dst = row_buf [row]; + p = MOD (p - 1, prev_total_rows); + q--; - copy_line (dst, src); + copy_line (row_buf [q], prev_row_buf [p]); } + while (p != pend); - for (int row = prev_nrow; row < nrow; row++) - scr_blank_screen_mem (row_buf [row], DEFAULT_RSTYLE); - - term_start = 0; + screen.cur.row += nrow - prev_nrow; + term_start = total_rows - nrow; } clamp_it (screen.cur.row, 0, nrow - 1); clamp_it (screen.cur.col, 0, ncol - 1); } + // ensure drawn_buf, swap_buf and terminal rows are all initialized for (int row = nrow; row--; ) { if (!ROW (row).valid ()) scr_blank_screen_mem (ROW (row), DEFAULT_RSTYLE); @@ -2716,13 +2718,17 @@ if (data[i] == C0_LF) data[i] = C0_CR; - if (priv_modes & PrivMode_BracketPaste) + #if ENABLE_FRILLS + if ((priv_modes & PrivMode_BracketPaste) && !option (Opt_disablePasteBrackets)) tt_printf ("\x1b[200~"); + #endif tt_write (data, len); - if (priv_modes & PrivMode_BracketPaste) + #if ENABLE_FRILLS + if ((priv_modes & PrivMode_BracketPaste) && !option (Opt_disablePasteBrackets)) tt_printf ("\x1b[201~"); + #endif } void @@ -2852,7 +2858,7 @@ #if ENABLE_COMBINING else if (IS_COMPOSE (*t)) { - int len = rxvt_composite.expand (*t, 0); + int len = rxvt_composite.expand (*t); extra -= (len - 1);