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.302 by sasha, Wed Feb 6 16:44:47 2008 UTC vs.
Revision 1.306 by root, Sun Jun 15 10:15:39 2008 UTC

1225/* 1225/*
1226 * Erase part or whole of a line 1226 * Erase part or whole of a line
1227 * XTERM_SEQ: Clear line to right: ESC [ 0 K 1227 * XTERM_SEQ: Clear line to right: ESC [ 0 K
1228 * XTERM_SEQ: Clear line to left : ESC [ 1 K 1228 * XTERM_SEQ: Clear line to left : ESC [ 1 K
1229 * XTERM_SEQ: Clear whole line : ESC [ 2 K 1229 * XTERM_SEQ: Clear whole line : ESC [ 2 K
1230 * extension: clear to right unless wrapped: ESC [ 3 K
1230 */ 1231 */
1231void 1232void
1232rxvt_term::scr_erase_line (int mode) NOTHROW 1233rxvt_term::scr_erase_line (int mode) NOTHROW
1233{ 1234{
1234 unsigned int col, num; 1235 unsigned int col, num;
1243 line.touch (); 1244 line.touch ();
1244 line.is_longer (0); 1245 line.is_longer (0);
1245 1246
1246 switch (mode) 1247 switch (mode)
1247 { 1248 {
1249 case 3:
1250 if (screen.flags & Screen_WrapNext)
1251 return;
1252
1253 /* fall through */
1254
1248 case 0: /* erase to end of line */ 1255 case 0: /* erase to end of line */
1249 col = screen.cur.col; 1256 col = screen.cur.col;
1250 num = ncol - col; 1257 num = ncol - col;
1251 min_it (line.l, col); 1258 min_it (line.l, col);
1259
1252 if (ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur) 1260 if (ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur)
1253 || ROWCOL_IN_ROW_AT_OR_AFTER (selection.end, screen.cur)) 1261 || ROWCOL_IN_ROW_AT_OR_AFTER (selection.end, screen.cur))
1254 CLEAR_SELECTION (); 1262 CLEAR_SELECTION ();
1255 break; 1263 break;
1264
1256 case 1: /* erase to beginning of line */ 1265 case 1: /* erase to beginning of line */
1257 col = 0; 1266 col = 0;
1258 num = screen.cur.col + 1; 1267 num = screen.cur.col + 1;
1268
1259 if (ROWCOL_IN_ROW_AT_OR_BEFORE (selection.beg, screen.cur) 1269 if (ROWCOL_IN_ROW_AT_OR_BEFORE (selection.beg, screen.cur)
1260 || ROWCOL_IN_ROW_AT_OR_BEFORE (selection.end, screen.cur)) 1270 || ROWCOL_IN_ROW_AT_OR_BEFORE (selection.end, screen.cur))
1261 CLEAR_SELECTION (); 1271 CLEAR_SELECTION ();
1262 break; 1272 break;
1273
1263 case 2: /* erase whole line */ 1274 case 2: /* erase whole line */
1264 col = 0; 1275 col = 0;
1265 num = ncol; 1276 num = ncol;
1266 line.l = 0; 1277 line.l = 0;
1267 if (selection.beg.row <= screen.cur.row 1278 if (selection.beg.row <= screen.cur.row
1992 return; 2003 return;
1993 2004
1994 /* 2005 /*
1995 * A: set up vars 2006 * A: set up vars
1996 */ 2007 */
2008 refresh_count = 0;
2009
1997 have_bg = 0; 2010 have_bg = 0;
1998 refresh_count = 0;
1999
2000#ifdef HAVE_BG_PIXMAP 2011#ifdef HAVE_BG_PIXMAP
2001 have_bg |= bgPixmap.pixmap != None; 2012 have_bg = bgPixmap.pixmap != None;
2002#endif 2013#endif
2003 ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ 2014 ocrow = oldcursor.row; /* is there an old outline cursor on screen? */
2004 2015
2005 /* 2016 /*
2006 * B: reverse any characters which are selected 2017 * B: reverse any characters which are selected
2478 2489
2479 if (scrollBar.win) 2490 if (scrollBar.win)
2480 { 2491 {
2481 XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]); 2492 XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]);
2482 scrollBar.state = STATE_IDLE; 2493 scrollBar.state = STATE_IDLE;
2483 scrollbar_show (0); 2494 scrollBar.show (0);
2484 } 2495 }
2485 2496
2486#endif 2497#endif
2487 2498
2488 /* bgPixmap.apply () does not do the following : */ 2499 /* bgPixmap.apply () does not do the following : */
2585{ 2596{
2586 int row, wrote; 2597 int row, wrote;
2587 unsigned int width, towrite; 2598 unsigned int width, towrite;
2588 char r1[] = "\n"; 2599 char r1[] = "\n";
2589 2600
2590 for (row = saveLines - nsaved; 2601 for (row = saveLines + top_row;
2591 row < saveLines + nrow - 1; row++) 2602 row < saveLines + nrow - 1; row++)
2592 { 2603 {
2593 width = row_buf[row].l >= 0 ? row_buf[row].l 2604 width = row_buf[row].l >= 0 ? row_buf[row].l
2594 : ncol; 2605 : ncol;
2595 for (towrite = width; towrite; towrite -= wrote) 2606 for (towrite = width; towrite; towrite -= wrote)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines