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.305 by ayin, Thu Feb 21 10:30:24 2008 UTC vs.
Revision 1.313 by root, Tue Nov 4 14:25:10 2008 UTC

83 ROW_AND_COL_IN_ROW_AT_OR_AFTER ((X).row, (X).col, (Y).row, (Y).col) 83 ROW_AND_COL_IN_ROW_AT_OR_AFTER ((X).row, (X).col, (Y).row, (Y).col)
84#define ROWCOL_IN_ROW_AT_OR_BEFORE(X, Y) \ 84#define ROWCOL_IN_ROW_AT_OR_BEFORE(X, Y) \
85 ROW_AND_COL_IN_ROW_AT_OR_BEFORE ((X).row, (X).col, (Y).row, (Y).col) 85 ROW_AND_COL_IN_ROW_AT_OR_BEFORE ((X).row, (X).col, (Y).row, (Y).col)
86 86
87/* 87/*
88 * CLEAR_ROWS : clear <num> rows starting from row <row>
89 * CLEAR_CHARS: clear <num> chars starting from pixel position <x,y> 88 * CLEAR_CHARS: clear <num> chars starting from pixel position <x,y>
90 * ERASE_ROWS : set <num> rows starting from row <row> to the foreground colour
91 */ 89 */
92#define CLEAR_ROWS(row, num) \
93 if (mapped) \
94 XClearArea (dpy, vt, 0, \
95 Row2Pixel (row), (unsigned int)width, \
96 (unsigned int)Height2Pixel (num), False)
97
98#define CLEAR_CHARS(x, y, num) \ 90#define CLEAR_CHARS(x, y, num) \
99 if (mapped) \ 91 if (mapped) \
100 XClearArea (dpy, vt, x, y, \ 92 XClearArea (dpy, vt, x, y, \
101 (unsigned int)Width2Pixel (num), \ 93 (unsigned int)Width2Pixel (num), \
102 (unsigned int)Height2Pixel (1), False) 94 (unsigned int)Height2Pixel (1), False)
103 95
104#define ERASE_ROWS(row, num) \
105 XFillRectangle (dpy, vt, gc, \
106 0, Row2Pixel (row), \
107 (unsigned int)width, \
108 (unsigned int)Height2Pixel (num))
109
110/* ------------------------------------------------------------------------- * 96/* ------------------------------------------------------------------------- *
111 * SCREEN `COMMON' ROUTINES * 97 * SCREEN `COMMON' ROUTINES *
112 * ------------------------------------------------------------------------- */ 98 * ------------------------------------------------------------------------- */
113 99
114/* Fill part/all of a line with blanks. */ 100/* Fill part/all of a line with blanks. */
144{ 130{
145 scr_blank_line (l, 0, ncol, efs); 131 scr_blank_line (l, 0, ncol, efs);
146 132
147 l.l = 0; 133 l.l = 0;
148 l.f = 0; 134 l.f = 0;
135}
136
137// nuke a single wide character at the given column
138void
139rxvt_term::scr_kill_char (line_t &l, int col) const NOTHROW
140{
141 // find begin
142 while (col > 0 && l.t[col] == NOCHAR)
143 col--;
144
145 rend_t rend = l.r[col] & ~RS_baseattrMask;
146 rend = SET_FONT (rend, FONTSET (rend)->find_font (' '));
147
148 // found begin, nuke
149 do {
150 l.t[col] = ' ';
151 l.r[col] = rend;
152 col++;
153 } while (col < ncol && l.t[col] == NOCHAR);
149} 154}
150 155
151/* ------------------------------------------------------------------------- * 156/* ------------------------------------------------------------------------- *
152 * SCREEN INITIALISATION * 157 * SCREEN INITIALISATION *
153 * ------------------------------------------------------------------------- */ 158 * ------------------------------------------------------------------------- */
785 790
786 while (str < strend) 791 while (str < strend)
787 { 792 {
788 c = (unicode_t)*str++; // convert to rxvt-unicodes representation 793 c = (unicode_t)*str++; // convert to rxvt-unicodes representation
789 794
790 if (c < 0x20) 795 if (expect_false (c < 0x20))
791 if (c == C0_LF) 796 if (c == C0_LF)
792 { 797 {
793 max_it (line->l, screen.cur.col); 798 max_it (line->l, screen.cur.col);
794 799
795 screen.flags &= ~Screen_WrapNext; 800 screen.flags &= ~Screen_WrapNext;
814 { 819 {
815 scr_tab (1, true); 820 scr_tab (1, true);
816 continue; 821 continue;
817 } 822 }
818 823
824 if (expect_false (
819 if (checksel /* see if we're writing within selection */ 825 checksel /* see if we're writing within selection */
820 && !ROWCOL_IS_BEFORE (screen.cur, selection.beg) 826 && !ROWCOL_IS_BEFORE (screen.cur, selection.beg)
821 && ROWCOL_IS_BEFORE (screen.cur, selection.end)) 827 && ROWCOL_IS_BEFORE (screen.cur, selection.end)
828 ))
822 { 829 {
823 checksel = 0; 830 checksel = 0;
824 /* 831 /*
825 * If we wrote anywhere in the selected area, kill the selection 832 * If we wrote anywhere in the selected area, kill the selection
826 * XXX: should we kill the mark too? Possibly, but maybe that 833 * XXX: should we kill the mark too? Possibly, but maybe that
827 * should be a similar check. 834 * should be a similar check.
828 */ 835 */
829 CLEAR_SELECTION (); 836 CLEAR_SELECTION ();
830 } 837 }
831 838
832 if (screen.flags & Screen_WrapNext) 839 if (expect_false (screen.flags & Screen_WrapNext))
833 { 840 {
834 scr_do_wrap (); 841 scr_do_wrap ();
835 842
836 line->l = ncol; 843 line->l = ncol;
837 line->is_longer (1); 844 line->is_longer (1);
839 row = screen.cur.row; 846 row = screen.cur.row;
840 line = &ROW(row); /* _must_ refresh */ 847 line = &ROW(row); /* _must_ refresh */
841 } 848 }
842 849
843 // some utf-8 decoders "decode" surrogate characters: let's fix this. 850 // some utf-8 decoders "decode" surrogate characters: let's fix this.
844 if (IN_RANGE_INC (c, 0xd800, 0xdfff)) 851 if (expect_false (IN_RANGE_INC (c, 0xd800, 0xdfff)))
845 c = 0xfffd; 852 c = 0xfffd;
846 853
847 // rely on wcwidth to tell us the character width, do wcwidth before 854 // rely on wcwidth to tell us the character width, do wcwidth before
848 // further replacements, as wcwidth might return -1 for the line 855 // further replacements, as wcwidth might return -1 for the line
849 // drawing characters below as they might be invalid in the current 856 // drawing characters below as they might be invalid in the current
850 // locale. 857 // locale.
851 int width = WCWIDTH (c); 858 int width = WCWIDTH (c);
852 859
853 if (charsets [screen.charset] == '0') // DEC SPECIAL 860 if (expect_false (charsets [screen.charset] == '0')) // DEC SPECIAL
854 { 861 {
855 // vt100 special graphics and line drawing 862 // vt100 special graphics and line drawing
856 // 5f-7e standard vt100 863 // 5f-7e standard vt100
857 // 40-5e rxvt extension for extra curses acs chars 864 // 40-5e rxvt extension for extra curses acs chars
858 static uint16_t vt100_0[62] = { // 41 .. 7e 865 static uint16_t vt100_0[62] = { // 41 .. 7e
871 c = vt100_0[c - 0x41]; 878 c = vt100_0[c - 0x41];
872 width = 1; // vt100 line drawing characters are always single-width 879 width = 1; // vt100 line drawing characters are always single-width
873 } 880 }
874 } 881 }
875 882
876 if (screen.flags & Screen_Insert) 883 if (expect_false (screen.flags & Screen_Insert))
877 scr_insdel_chars (width, INSERT); 884 scr_insdel_chars (width, INSERT);
878 885
879 if (width != 0) 886 if (width != 0)
880 { 887 {
881#if !UNICODE_3 888#if !UNICODE_3
887 c = 0xfffd; 894 c = 0xfffd;
888# endif 895# endif
889#endif 896#endif
890 897
891 // nuke the character at this position, if required 898 // nuke the character at this position, if required
899 if (expect_false (
892 if (line->t[screen.cur.col] == NOCHAR 900 line->t[screen.cur.col] == NOCHAR
893 || (screen.cur.col < ncol - 1 901 || (screen.cur.col < ncol - 1
894 && line->t[screen.cur.col + 1] == NOCHAR)) 902 && line->t[screen.cur.col + 1] == NOCHAR)
895 { 903 ))
896 int col = screen.cur.col; 904 scr_kill_char (*line, screen.cur.col);
897
898 // find begin
899 while (col > 0 && line->t[col] == NOCHAR)
900 col--;
901
902 rend_t rend = SET_FONT (line->r[col], FONTSET (line->r[col])->find_font (' '));
903
904 // found begin, nuke
905 do {
906 line->t[col] = ' ';
907 line->r[col] = rend;
908 col++;
909 } while (col < ncol && line->t[col] == NOCHAR);
910 }
911 905
912 rend_t rend = SET_FONT (rstyle, FONTSET (rstyle)->find_font (c)); 906 rend_t rend = SET_FONT (rstyle, FONTSET (rstyle)->find_font (c));
913 907
914 // if the character doesn't fit into the remaining columns... 908 // if the character doesn't fit into the remaining columns...
915 if (screen.cur.col > ncol - width && ncol >= width) 909 if (expect_false (screen.cur.col > ncol - width && ncol >= width))
916 { 910 {
917 // ...output spaces 911 // ...output spaces
918 c = ' '; 912 c = ' ';
919 // and try the same character next loop iteration 913 // and try the same character next loop iteration
920 --str; 914 --str;
925 do 919 do
926 { 920 {
927 line->t[screen.cur.col] = c; 921 line->t[screen.cur.col] = c;
928 line->r[screen.cur.col] = rend; 922 line->r[screen.cur.col] = rend;
929 923
930 if (screen.cur.col < ncol - 1) 924 if (expect_true (screen.cur.col < ncol - 1))
931 screen.cur.col++; 925 screen.cur.col++;
932 else 926 else
933 { 927 {
934 line->l = ncol; 928 line->l = ncol;
935 if (screen.flags & Screen_Autowrap) 929 if (screen.flags & Screen_Autowrap)
937 break; 931 break;
938 } 932 }
939 933
940 c = NOCHAR; 934 c = NOCHAR;
941 } 935 }
942 while (--width > 0); 936 while (expect_false (--width > 0));
943 937
944 // pad with spaces when overwriting wide character with smaller one 938 // pad with spaces when overwriting wide character with smaller one
945 if (!width) 939 if (expect_false (!width))
946 { 940 {
947 line->touch (); 941 line->touch ();
948 942
949 for (int c = screen.cur.col; c < ncol && line->t[c] == NOCHAR; c++) 943 for (int c = screen.cur.col; c < ncol && line->t[c] == NOCHAR; c++)
950 { 944 {
951 line->t[c] = ' '; 945 line->t[c] = ' ';
952 line->r[c] = rend; 946 line->r[c] = rend;
953 } 947 }
954 } 948 }
955 } 949 }
950#if ENABLE_COMBINING
956 else // width == 0 951 else // width == 0
957 { 952 {
958#if ENABLE_COMBINING 953 if (c != 0xfeff) // ignore BOM
959 // handle combining characters
960 // we just tag the accent on the previous on-screen character.
961 // this is arguably not correct, but also arguably not wrong.
962 // we don't handle double-width characters nicely yet.
963 line_t *linep;
964 text_t *tp;
965 rend_t *rp;
966
967 if (screen.cur.col > 0)
968 { 954 {
955 // handle combining characters
956 // we just tag the accent on the previous on-screen character.
957 // this is arguably not correct, but also arguably not wrong.
958 // we don't handle double-width characters nicely yet.
959 line_t *linep;
960 text_t *tp;
961 rend_t *rp;
962
963 if (screen.cur.col > 0)
964 {
969 linep = line; 965 linep = line;
970 tp = line->t + screen.cur.col - 1; 966 tp = line->t + screen.cur.col - 1;
971 rp = line->r + screen.cur.col - 1; 967 rp = line->r + screen.cur.col - 1;
968 }
969 else if (screen.cur.row > 0
970 && ROW(screen.cur.row - 1).is_longer ())
971 {
972 linep = &ROW(screen.cur.row - 1);
973 tp = line->t + ncol - 1;
974 rp = line->r + ncol - 1;
975 }
976 else
977 continue;
978
979 linep->touch ();
980
981 while (*tp == NOCHAR && tp > linep->t)
982 tp--, rp--;
983
984 // first try to find a precomposed character
985 unicode_t n = rxvt_compose (*tp, c);
986 if (n == NOCHAR)
987 n = rxvt_composite.compose (*tp, c);
988
989 *tp = n;
990 *rp = SET_FONT (*rp, FONTSET (*rp)->find_font (*tp));
972 } 991 }
973 else if (screen.cur.row > 0
974 && ROW(screen.cur.row - 1).is_longer ())
975 {
976 linep = &ROW(screen.cur.row - 1);
977 tp = line->t + ncol - 1;
978 rp = line->r + ncol - 1;
979 } 992 }
980 else
981 continue;
982
983 linep->touch ();
984
985 while (*tp == NOCHAR && tp > linep->t)
986 tp--, rp--;
987
988 // first try to find a precomposed character
989 unicode_t n = rxvt_compose (*tp, c);
990 if (n == NOCHAR)
991 n = rxvt_composite.compose (*tp, c);
992
993 *tp = n;
994 *rp = SET_FONT (*rp, FONTSET (*rp)->find_font (*tp));
995#endif 993#endif
996 }
997 } 994 }
998 995
999 max_it (line->l, screen.cur.col); 996 max_it (line->l, screen.cur.col);
1000 997
1001#ifdef DEBUG_STRICT 998#ifdef DEBUG_STRICT
1225/* 1222/*
1226 * Erase part or whole of a line 1223 * Erase part or whole of a line
1227 * XTERM_SEQ: Clear line to right: ESC [ 0 K 1224 * XTERM_SEQ: Clear line to right: ESC [ 0 K
1228 * XTERM_SEQ: Clear line to left : ESC [ 1 K 1225 * XTERM_SEQ: Clear line to left : ESC [ 1 K
1229 * XTERM_SEQ: Clear whole line : ESC [ 2 K 1226 * XTERM_SEQ: Clear whole line : ESC [ 2 K
1227 * extension: clear to right unless wrapped: ESC [ 3 K
1230 */ 1228 */
1231void 1229void
1232rxvt_term::scr_erase_line (int mode) NOTHROW 1230rxvt_term::scr_erase_line (int mode) NOTHROW
1233{ 1231{
1234 unsigned int col, num; 1232 unsigned int col, num;
1243 line.touch (); 1241 line.touch ();
1244 line.is_longer (0); 1242 line.is_longer (0);
1245 1243
1246 switch (mode) 1244 switch (mode)
1247 { 1245 {
1246 case 3:
1247 if (screen.flags & Screen_WrapNext)
1248 return;
1249
1250 /* fall through */
1251
1248 case 0: /* erase to end of line */ 1252 case 0: /* erase to end of line */
1249 col = screen.cur.col; 1253 col = screen.cur.col;
1250 num = ncol - col; 1254 num = ncol - col;
1251 min_it (line.l, col); 1255 min_it (line.l, col);
1256
1252 if (ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur) 1257 if (ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur)
1253 || ROWCOL_IN_ROW_AT_OR_AFTER (selection.end, screen.cur)) 1258 || ROWCOL_IN_ROW_AT_OR_AFTER (selection.end, screen.cur))
1254 CLEAR_SELECTION (); 1259 CLEAR_SELECTION ();
1255 break; 1260 break;
1261
1256 case 1: /* erase to beginning of line */ 1262 case 1: /* erase to beginning of line */
1257 col = 0; 1263 col = 0;
1258 num = screen.cur.col + 1; 1264 num = screen.cur.col + 1;
1265
1259 if (ROWCOL_IN_ROW_AT_OR_BEFORE (selection.beg, screen.cur) 1266 if (ROWCOL_IN_ROW_AT_OR_BEFORE (selection.beg, screen.cur)
1260 || ROWCOL_IN_ROW_AT_OR_BEFORE (selection.end, screen.cur)) 1267 || ROWCOL_IN_ROW_AT_OR_BEFORE (selection.end, screen.cur))
1261 CLEAR_SELECTION (); 1268 CLEAR_SELECTION ();
1262 break; 1269 break;
1270
1263 case 2: /* erase whole line */ 1271 case 2: /* erase whole line */
1264 col = 0; 1272 col = 0;
1265 num = ncol; 1273 num = ncol;
1266 line.l = 0; 1274 line.l = 0;
1267 if (selection.beg.row <= screen.cur.row 1275 if (selection.beg.row <= screen.cur.row
1325 if (row >= nrow) /* Out Of Bounds */ 1333 if (row >= nrow) /* Out Of Bounds */
1326 return; 1334 return;
1327 1335
1328 min_it (num, nrow - row); 1336 min_it (num, nrow - row);
1329 1337
1338 /*TODO: the xlceararea/xfillrectangle below don't take scroll offste into account, ask mikachu for details */
1330 if (rstyle & (RS_RVid | RS_Uline)) 1339 if (rstyle & (RS_RVid | RS_Uline))
1331 ren = (rend_t) ~RS_None; 1340 ren = (rend_t) ~RS_None;
1332 else if (GET_BASEBG (rstyle) == Color_bg) 1341 else if (GET_BASEBG (rstyle) == Color_bg)
1333 { 1342 {
1334 ren = DEFAULT_RSTYLE; 1343 ren = DEFAULT_RSTYLE;
1335 CLEAR_ROWS (row, num); 1344
1345 if (mapped)
1346 XClearArea (dpy, vt, 0,
1347 Row2Pixel (row), (unsigned int)width,
1348 (unsigned int)Height2Pixel (num), False);
1336 } 1349 }
1337 else 1350 else
1338 { 1351 {
1339 ren = rstyle & (RS_fgMask | RS_bgMask); 1352 ren = rstyle & (RS_fgMask | RS_bgMask);
1353
1340 gcvalue.foreground = pix_colors[bgcolor_of (rstyle)]; 1354 gcvalue.foreground = pix_colors[bgcolor_of (rstyle)];
1341 XChangeGC (dpy, gc, GCForeground, &gcvalue); 1355 XChangeGC (dpy, gc, GCForeground, &gcvalue);
1342 ERASE_ROWS (row, num); 1356 XFillRectangle (dpy, vt, gc,
1357 0, Row2Pixel (row),
1358 (unsigned int)width,
1359 (unsigned int)Height2Pixel (num));
1343 gcvalue.foreground = pix_colors[Color_fg]; 1360 gcvalue.foreground = pix_colors[Color_fg];
1344 XChangeGC (dpy, gc, GCForeground, &gcvalue); 1361 XChangeGC (dpy, gc, GCForeground, &gcvalue);
1345 } 1362 }
1346 1363
1347 for (; num--; row++) 1364 for (; num--; row++)
1484 case ERASE: 1501 case ERASE:
1485 screen.cur.col += count; /* don't worry if > ncol */ 1502 screen.cur.col += count; /* don't worry if > ncol */
1486 selection_check (1); 1503 selection_check (1);
1487 screen.cur.col -= count; 1504 screen.cur.col -= count;
1488 1505
1489 line->l = max (line->l - count, 0);
1490 scr_blank_line (*line, screen.cur.col, count, rstyle); 1506 scr_blank_line (*line, screen.cur.col, count, rstyle);
1491 break; 1507 break;
1492 1508
1493 case DELETE: 1509 case DELETE:
1494 tr = line->r[ncol - 1] & (RS_fgMask | RS_bgMask | RS_baseattrMask); 1510 tr = line->r[ncol - 1] & (RS_fgMask | RS_bgMask | RS_baseattrMask);
1886 XMapWindow (dpy, parent[0]); 1902 XMapWindow (dpy, parent[0]);
1887# endif 1903# endif
1888 1904
1889# if ENABLE_FRILLS 1905# if ENABLE_FRILLS
1890 if (option (Opt_urgentOnBell)) 1906 if (option (Opt_urgentOnBell))
1891 { 1907 set_urgency (1);
1892 if (XWMHints *h = XGetWMHints(dpy, parent[0]))
1893 {
1894 h->flags |= XUrgencyHint;
1895 XSetWMHints (dpy, parent[0], h);
1896 }
1897 }
1898# endif 1908# endif
1899 1909
1900 if (option (Opt_visualBell)) 1910 if (option (Opt_visualBell))
1901 { 1911 {
1902 rvideo_bell = true; 1912 rvideo_bell = true;
1915void 1925void
1916rxvt_term::scr_printscreen (int fullhist) NOTHROW 1926rxvt_term::scr_printscreen (int fullhist) NOTHROW
1917{ 1927{
1918#ifdef PRINTPIPE 1928#ifdef PRINTPIPE
1919 int nrows, row_start; 1929 int nrows, row_start;
1920 FILE *fd; 1930 FILE *fd = popen_printer ();
1921 1931
1922 if ((fd = popen_printer ()) == NULL) 1932 if (!fd)
1923 return; 1933 return;
1924 1934
1925 if (fullhist) 1935 if (fullhist)
1926 { 1936 {
1927 nrows = nrow - top_row; 1937 nrows = nrow - top_row;
2197 continue; 2207 continue;
2198 2208
2199 // redraw one or more characters 2209 // redraw one or more characters
2200 2210
2201 // seek to the beginning of wide characters 2211 // seek to the beginning of wide characters
2202 while (stp[col] == NOCHAR && col > 0) 2212 while (expect_false (stp[col] == NOCHAR && col > 0))
2203 --col; 2213 --col;
2204 2214
2205 rend_t rend = srp[col]; /* screen rendition (target rendtion) */ 2215 rend_t rend = srp[col]; /* screen rendition (target rendtion) */
2206 text_t *text = stp + col; 2216 text_t *text = stp + col;
2207 int count = 1; 2217 int count = 1;
2244 2254
2245 col--; /* went one too far. move back */ 2255 col--; /* went one too far. move back */
2246 count -= i; /* dump any matching trailing chars */ 2256 count -= i; /* dump any matching trailing chars */
2247 2257
2248 // sometimes we optimize away the trailing NOCHAR's, add them back 2258 // sometimes we optimize away the trailing NOCHAR's, add them back
2249 while (i && text[count] == NOCHAR) 2259 while (expect_false (i && text[count] == NOCHAR))
2250 count++, i--; 2260 count++, i--;
2251 2261
2252 /* 2262 /*
2253 * Determine the attributes for the string 2263 * Determine the attributes for the string
2254 */ 2264 */
2255 int fore = fgcolor_of (rend); // desired foreground 2265 int fore = fgcolor_of (rend); // desired foreground
2256 int back = bgcolor_of (rend); // desired background 2266 int back = bgcolor_of (rend); // desired background
2257 2267
2258 // only do special processing if any attributes are set, which is unlikely 2268 // only do special processing if any attributes are set, which is unlikely
2259 if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)) 2269 if (expect_false (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)))
2260 { 2270 {
2261 bool invert = rend & RS_RVid; 2271 bool invert = rend & RS_RVid;
2262 2272
2263#ifndef NO_BOLD_UNDERLINE_REVERSE 2273#ifndef NO_BOLD_UNDERLINE_REVERSE
2264 if (rend & RS_Bold && fore == Color_fg) 2274 if (rend & RS_Bold && fore == Color_fg)
2347 /* 2357 /*
2348 * Actually do the drawing of the string here 2358 * Actually do the drawing of the string here
2349 */ 2359 */
2350 rxvt_font *font = (*fontset[GET_STYLE (rend)])[GET_FONT (rend)]; 2360 rxvt_font *font = (*fontset[GET_STYLE (rend)])[GET_FONT (rend)];
2351 2361
2352 if (have_bg && back == Color_bg) 2362 if (expect_true (have_bg && back == Color_bg))
2353 { 2363 {
2354 // this is very ugly, maybe push it into ->draw? 2364 // this is very ugly, maybe push it into ->draw?
2355 2365
2356 for (i = 0; i < count; i++) /* don't draw empty strings */ 2366 for (i = 0; i < count; i++) /* don't draw empty strings */
2357 if (text[i] != ' ') 2367 if (text[i] != ' ')
2364 did_clear: ; 2374 did_clear: ;
2365 } 2375 }
2366 else 2376 else
2367 font->draw (*drawable, xpixel, ypixel, text, count, fore, back); 2377 font->draw (*drawable, xpixel, ypixel, text, count, fore, back);
2368 2378
2369 if (rend & RS_Uline && font->descent > 1 && fore != back) 2379 if (expect_false (rend & RS_Uline && font->descent > 1 && fore != back))
2370 { 2380 {
2371#if ENABLE_FRILLS 2381#if ENABLE_FRILLS
2372 if (ISSET_PIXCOLOR (Color_underline)) 2382 if (ISSET_PIXCOLOR (Color_underline))
2373 XSetForeground (dpy, gc, pix_colors[Color_underline]); 2383 XSetForeground (dpy, gc, pix_colors[Color_underline]);
2374 else 2384 else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines