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.438 by sf-exg, Mon Mar 25 15:41:07 2013 UTC vs.
Revision 1.442 by sf-exg, Sat Mar 30 08:47:06 2013 UTC

715 715
716 // finally move the view window, if desired 716 // finally move the view window, if desired
717 if (option (Opt_scrollWithBuffer) 717 if (option (Opt_scrollWithBuffer)
718 && view_start != 0 718 && view_start != 0
719 && view_start != -saveLines) 719 && view_start != -saveLines)
720 scr_page (UP, count); 720 scr_page (count);
721 721
722 if (SHOULD_INVOKE (HOOK_SCROLL_BACK)) 722 if (SHOULD_INVOKE (HOOK_SCROLL_BACK))
723 HOOK_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, top_row, DT_END)); 723 HOOK_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, top_row, DT_END));
724 } 724 }
725 else 725 else
1240 * direction should be UP or DN 1240 * direction should be UP or DN
1241 */ 1241 */
1242void 1242void
1243rxvt_term::scr_index (enum page_dirn direction) NOTHROW 1243rxvt_term::scr_index (enum page_dirn direction) NOTHROW
1244{ 1244{
1245 int dirn;
1246
1247 want_refresh = 1; 1245 want_refresh = 1;
1248 ZERO_SCROLLBACK (); 1246 ZERO_SCROLLBACK ();
1249 1247
1250 dirn = ((direction == UP) ? 1 : -1);
1251
1252 screen.flags &= ~Screen_WrapNext; 1248 screen.flags &= ~Screen_WrapNext;
1253 1249
1254 if ((screen.cur.row == screen.bscroll && direction == UP) 1250 if ((screen.cur.row == screen.bscroll && direction == UP)
1255 || (screen.cur.row == screen.tscroll && direction == DN)) 1251 || (screen.cur.row == screen.tscroll && direction == DN))
1256 scr_scroll_text (screen.tscroll, screen.bscroll, dirn); 1252 scr_scroll_text (screen.tscroll, screen.bscroll, direction);
1257 else 1253 else
1258 screen.cur.row += dirn; 1254 screen.cur.row += direction;
1259 1255
1260 clamp_it (screen.cur.row, 0, nrow - 1); 1256 clamp_it (screen.cur.row, 0, nrow - 1);
1261 selection_check (0); 1257 selection_check (0);
1262} 1258}
1263 1259
1910/* 1906/*
1911 * Page the screen up/down nlines 1907 * Page the screen up/down nlines
1912 * direction should be UP or DN 1908 * direction should be UP or DN
1913 */ 1909 */
1914bool 1910bool
1915rxvt_term::scr_page (enum page_dirn direction, int nlines) NOTHROW 1911rxvt_term::scr_page (int nlines) NOTHROW
1916{ 1912{
1917 int new_view_start =
1918 direction == UP ? view_start - nlines
1919 : view_start + nlines;
1920
1921 return scr_changeview (new_view_start); 1913 return scr_changeview (view_start - nlines);
1922} 1914}
1923 1915
1924bool 1916bool
1925rxvt_term::scr_changeview (int new_view_start) NOTHROW 1917rxvt_term::scr_changeview (int new_view_start) NOTHROW
1926{ 1918{
2083 2075
2084 /* 2076 /*
2085 * C: set the cursor character (s) 2077 * C: set the cursor character (s)
2086 */ 2078 */
2087 { 2079 {
2088 bool setoldcursor;
2089
2090#ifdef CURSOR_BLINK 2080#ifdef CURSOR_BLINK
2091 if (hidden_cursor) 2081 if (hidden_cursor)
2092 showcursor = 0; 2082 showcursor = 0;
2093#endif 2083#endif
2094 2084
2145 scr_set_char_rend (ROW(screen.cur.row), cur_col, rend); 2135 scr_set_char_rend (ROW(screen.cur.row), cur_col, rend);
2146 } 2136 }
2147 } 2137 }
2148 2138
2149 /* make sure no outline cursor is left around */ 2139 /* make sure no outline cursor is left around */
2150 setoldcursor = 0;
2151 if (ocrow != -1) 2140 if (ocrow != -1)
2152 { 2141 {
2153 if (screen.cur.row - view_start != ocrow 2142 if (screen.cur.row - view_start != ocrow
2154 || screen.cur.col != oldcursor.col) 2143 || screen.cur.col != oldcursor.col)
2155 { 2144 {
2156 if (ocrow < nrow 2145 if (ocrow < nrow
2157 && oldcursor.col < ncol) 2146 && oldcursor.col < ncol)
2158 drawn_buf[ocrow].r[oldcursor.col] ^= (RS_RVid | RS_Uline); 2147 drawn_buf[ocrow].r[oldcursor.col] ^= (RS_RVid | RS_Uline);
2159
2160 if (focus || !showcursor)
2161 oldcursor.row = -1;
2162 else
2163 setoldcursor = 1;
2164 } 2148 }
2165 } 2149 }
2166 else if (!focus)
2167 setoldcursor = 1;
2168 2150
2169 if (setoldcursor) 2151 // save the current cursor coordinates if the cursor is visible
2152 // and the window is unfocused, so as to clear the outline cursor
2153 // in the next refresh if the cursor moves
2154 if (showcursor && !focus && screen.cur.row - view_start < nrow)
2170 { 2155 {
2171 if (screen.cur.row - view_start >= nrow)
2172 oldcursor.row = -1;
2173 else
2174 {
2175 oldcursor.row = screen.cur.row - view_start; 2156 oldcursor.row = screen.cur.row - view_start;
2176 oldcursor.col = screen.cur.col; 2157 oldcursor.col = screen.cur.col;
2177 }
2178 } 2158 }
2159 else
2160 oldcursor.row = -1;
2179 } 2161 }
2180 2162
2181#ifndef NO_SLOW_LINK_SUPPORT 2163#ifndef NO_SLOW_LINK_SUPPORT
2182 /* 2164 /*
2183 * D: CopyArea pass - very useful for slower links 2165 * D: CopyArea pass - very useful for slower links
3090 break; 3072 break;
3091 } 3073 }
3092 3074
3093 if (dirn == DN) 3075 if (dirn == DN)
3094 col++; /* put us on one past the end */ 3076 col++; /* put us on one past the end */
3077 else
3078 {
3079 // if the delimiter on the left has width > 1 col points to the
3080 // first NOCHAR in the delimiter cell and so we must move it to the
3081 // beginning of the next cell.
3082 while (ROW(row).t[col] == NOCHAR)
3083 col++;
3084 }
3095 3085
3096 /* Poke the values back in */ 3086 /* Poke the values back in */
3097 ret->row = row; 3087 ret->row = row;
3098 ret->col = col; 3088 ret->col = col;
3099} 3089}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines