--- rxvt-unicode/src/screen.C 2013/03/30 08:47:06 1.442 +++ rxvt-unicode/src/screen.C 2014/10/30 09:53:05 1.448 @@ -7,7 +7,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -1899,7 +1899,8 @@ void rxvt_term::scr_move_to (int y, int len) NOTHROW { - scr_changeview ((top_row - nrow) * (len - y) / len + (nrow - 1)); + // lerp (y, 0, len, top_row, nrow - 1) + scr_changeview (top_row + (nrow - 1 - top_row) * y / len); } /* ------------------------------------------------------------------------- */ @@ -2119,11 +2120,11 @@ ccol2 = Color_bg; #endif - if (focus) + if (focus && cursor_type != 2) { rend_t rend = cur_rend; - if (option (Opt_cursorUnderline)) + if (cursor_type == 1) rend ^= RS_Uline; else { @@ -2140,7 +2141,7 @@ if (ocrow != -1) { if (screen.cur.row - view_start != ocrow - || screen.cur.col != oldcursor.col) + || screen.cur.col != oldcursor.col || !showcursor) { if (ocrow < nrow && oldcursor.col < ncol) @@ -2149,9 +2150,10 @@ } // save the current cursor coordinates if the cursor is visible - // and the window is unfocused, so as to clear the outline cursor - // in the next refresh if the cursor moves - if (showcursor && !focus && screen.cur.row - view_start < nrow) + // and either the window is unfocused or the cursor style is + // vertical bar, so as to clear the outline cursor in the next + // refresh if the cursor moves or becomes invisible + if (showcursor && (!focus || cursor_type == 2) && screen.cur.row - view_start < nrow) { oldcursor.row = screen.cur.row - view_start; oldcursor.col = screen.cur.col; @@ -2251,7 +2253,7 @@ if (stp[col] == dtp[col] /* Must match characters to skip. */ && (RS_SAME (srp[col], drp[col]) /* Either rendition the same or */ || (stp[col] == ' ' /* space w/ no background change */ - && GET_BGATTR (srp[col]) == GET_BGATTR (drp[col])))) + && !((srp[col] ^ drp[col]) & (RS_attrMask | RS_bgMask))))) continue; // redraw one or more characters @@ -2457,7 +2459,19 @@ if (showcursor) { if (focus) - scr_set_char_rend (ROW(screen.cur.row), cur_col, cur_rend); + { + if (cursor_type != 2) + scr_set_char_rend (ROW(screen.cur.row), cur_col, cur_rend); + else if (oldcursor.row >= 0) + { + XSetForeground (dpy, gc, pix_colors[ccol1]); + XFillRectangle (dpy, vt, gc, + Col2Pixel (cur_col), + Row2Pixel (oldcursor.row), + 1, + Height2Pixel (1)); + } + } else if (oldcursor.row >= 0) { XSetForeground (dpy, gc, pix_colors[ccol1]); @@ -2680,8 +2694,8 @@ rxvt_term::selection_changed () NOTHROW { line_t &r1 = ROW (selection.beg.row); - while (selection.beg.col > 0 && r1.t [selection.beg.col] == NOCHAR) - --selection.beg.col; + while (selection.beg.col < r1.l && r1.t [selection.beg.col] == NOCHAR) + ++selection.beg.col; line_t &r2 = ROW (selection.end.row); while (selection.end.col < r2.l && r2.t [selection.end.col] == NOCHAR) @@ -3074,14 +3088,6 @@ if (dirn == DN) col++; /* put us on one past the end */ - else - { - // if the delimiter on the left has width > 1 col points to the - // first NOCHAR in the delimiter cell and so we must move it to the - // beginning of the next cell. - while (ROW(row).t[col] == NOCHAR) - col++; - } /* Poke the values back in */ ret->row = row;