--- rxvt-unicode/src/rxvtperl.xs 2006/01/03 00:06:57 1.8 +++ rxvt-unicode/src/rxvtperl.xs 2006/01/03 01:29:55 1.10 @@ -316,6 +316,8 @@ set_hookname (REFRESH_END); set_hookname (KEYBOARD_COMMAND); + newCONSTSUB (gv_stashpv ("urxvt", 1), "DEFAULT_RSTYLE", newSViv (DEFAULT_RSTYLE)); + sv_setpv (get_sv ("urxvt::LIBDIR", 1), LIBDIR); } @@ -434,6 +436,11 @@ RETVAL void +rxvt_term::want_refresh () + CODE: + THIS->want_refresh = 1; + +void rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0) PPCODE: { @@ -466,17 +473,19 @@ int len = wcslen (wstr); - if (start_col + len > THIS->ncol) + if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) { free (wstr); - croak ("new_text extends beyond right margin"); + croak ("new_text extends beyond horizontal margins"); } for (int col = start_col; col < start_col + len; col++) { - l.t [col] = wstr [col]; + l.t [col] = wstr [col - start_col]; l.r [col] = SET_FONT (l.r [col], THIS->fontset [GET_STYLE (l.r [col])]->find_font (l.t [col])); } + + free (wstr); } } @@ -508,12 +517,12 @@ AV *av = (AV *)SvRV (new_rend); int len = av_len (av) + 1; - if (start_col + len > THIS->ncol) - croak ("new_rend array extends beyond right margin"); + if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) + croak ("new_rend array extends beyond horizontal margins"); for (int col = start_col; col < start_col + len; col++) { - rend_t r = SvIV (*av_fetch (av, col, 1)) & ~RS_fontMask; + rend_t r = SvIV (*av_fetch (av, col - start_col, 1)) & ~RS_fontMask; l.r [col] = SET_FONT (r, THIS->fontset [GET_STYLE (r)]->find_font (l.t [col])); }