From: root Date: Tue, 4 Nov 2008 14:25:10 +0000 (+0000) Subject: implement scr_kill_char X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=c3df32ccd49ff1f445e0ee78d6ef0d4cbb7c5479;p=dana%2Furxvt.git implement scr_kill_char --- diff --git a/src/rxvt.h b/src/rxvt.h index 0b14b9b1..2d0c2fbb 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -1355,6 +1355,7 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen { void paste (char *data, unsigned int len) NOTHROW; void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW; + void scr_kill_char (line_t &l, int col) const NOTHROW; int scr_scroll_text (int row1, int row2, int count) NOTHROW; void scr_reset (); void scr_release () NOTHROW; diff --git a/src/screen.C b/src/screen.C index 3fe37b46..5fddbf93 100644 --- a/src/screen.C +++ b/src/screen.C @@ -134,6 +134,25 @@ rxvt_term::scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW l.f = 0; } +// nuke a single wide character at the given column +void +rxvt_term::scr_kill_char (line_t &l, int col) const NOTHROW +{ + // find begin + while (col > 0 && l.t[col] == NOCHAR) + col--; + + rend_t rend = l.r[col] & ~RS_baseattrMask; + rend = SET_FONT (rend, FONTSET (rend)->find_font (' ')); + + // found begin, nuke + do { + l.t[col] = ' '; + l.r[col] = rend; + col++; + } while (col < ncol && l.t[col] == NOCHAR); +} + /* ------------------------------------------------------------------------- * * SCREEN INITIALISATION * * ------------------------------------------------------------------------- */ @@ -882,22 +901,7 @@ rxvt_term::scr_add_lines (const wchar_t *str, int len, int minlines) NOTHROW || (screen.cur.col < ncol - 1 && line->t[screen.cur.col + 1] == NOCHAR) )) - { - int col = screen.cur.col; - - // find begin - while (col > 0 && line->t[col] == NOCHAR) - col--; - - rend_t rend = SET_FONT (line->r[col], FONTSET (line->r[col])->find_font (' ')); - - // found begin, nuke - do { - line->t[col] = ' '; - line->r[col] = rend; - col++; - } while (col < ncol && line->t[col] == NOCHAR); - } + scr_kill_char (*line, screen.cur.col); rend_t rend = SET_FONT (rstyle, FONTSET (rstyle)->find_font (c));