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

Comparing rxvt-unicode/src/rxvtperl.xs (file contents):
Revision 1.104 by root, Mon Aug 7 22:28:18 2006 UTC vs.
Revision 1.106 by root, Tue Oct 3 12:13:57 2006 UTC

1122 CODE: 1122 CODE:
1123{ 1123{
1124 wchar_t *wstr = sv2wcs (str); 1124 wchar_t *wstr = sv2wcs (str);
1125 1125
1126 rxvt_push_locale (THIS->locale); 1126 rxvt_push_locale (THIS->locale);
1127 //TODO: use same algorithm as screen.C 1127 RETVAL = 0;
1128 RETVAL = wcswidth (wstr, wcslen (wstr)); 1128 for (wchar_t *wc = wstr; *wc; wc++)
1129 {
1130 int w = WCWIDTH (*wc);
1131
1132 if (w)
1133 RETVAL += min (w, 1);
1134 }
1129 rxvt_pop_locale (); 1135 rxvt_pop_locale ();
1130 1136
1131 free (wstr); 1137 free (wstr);
1132} 1138}
1133 OUTPUT: 1139 OUTPUT:
1163 rxvt_pop_locale (); 1169 rxvt_pop_locale ();
1164 1170
1165 RETVAL = wcs2sv (wstr); 1171 RETVAL = wcs2sv (wstr);
1166 free (wstr); 1172 free (wstr);
1167} 1173}
1174 OUTPUT:
1175 RETVAL
1176
1177char *
1178rxvt_term::locale ()
1179 CODE:
1180 RETVAL = THIS->locale;
1168 OUTPUT: 1181 OUTPUT:
1169 RETVAL 1182 RETVAL
1170 1183
1171#define TERM_OFFSET(sym) offsetof (TermWin_t, sym) 1184#define TERM_OFFSET(sym) offsetof (TermWin_t, sym)
1172 1185

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines