---
Hi,

Here's a patch for your consideration. The underline and recently added i-beam
cursors look a bit starved, and they in my opinion look cleaner with a
thickness of 2 pixels instead of just one. Additionally, the cursor loses its
shape when the terminal loses focus, which for the Vim use-case, is
unfortunate, because then it's impossible to tell which mode you're in once
you've gone to another window.

Thanks,
Omar

 src/screen.C | 53 ++++++++++++++++++++++++++++-------------------------
 1 file changed, 28 insertions(+), 25 deletions(-)

diff --git a/src/screen.C b/src/screen.C
index 1bccf6b..53329de 100644
--- a/src/screen.C
+++ b/src/screen.C
@@ -2120,18 +2120,13 @@ rxvt_term::scr_refresh () NOTHROW
           ccol2 = Color_bg;
 #endif
 
-        if (focus && cursor_type != 2)
+        if (focus && cursor_type == 0)
           {
             rend_t rend = cur_rend;
 
-            if (cursor_type == 1)
-              rend ^= RS_Uline;
-            else
-              {
-                rend ^= RS_RVid;
-                rend = SET_FGCOLOR (rend, ccol1);
-                rend = SET_BGCOLOR (rend, ccol2);
-              }
+            rend ^= RS_RVid;
+            rend = SET_FGCOLOR (rend, ccol1);
+            rend = SET_BGCOLOR (rend, ccol2);
 
             scr_set_char_rend (ROW(screen.cur.row), cur_col, rend);
           }
@@ -2150,10 +2145,10 @@ rxvt_term::scr_refresh () NOTHROW
       }
 
     // save the current cursor coordinates if the cursor is visible
-    // 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)
+    // and either the window is unfocused or the cursor style is an
+    // underline or a vertical bar, so as to clear the cursor in the
+    // next refresh if the cursor moves or becomes invisible
+    if (showcursor && (!focus || cursor_type != 0) && screen.cur.row - 
view_start < nrow)
       {
         oldcursor.row = screen.cur.row - view_start;
         oldcursor.col = screen.cur.col;
@@ -2455,19 +2450,27 @@ rxvt_term::scr_refresh () NOTHROW
    */
   if (showcursor)
     {
-      if (focus)
+      if (cursor_type == 1 && oldcursor.row >= 0)
         {
-          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));
-            }
+          XSetForeground (dpy, gc, pix_colors[ccol1]);
+          XFillRectangle (dpy, vt, gc,
+                          Col2Pixel (cur_col),
+                          Row2Pixel (oldcursor.row + 1) - 2,
+                          Width2Pixel (1),
+                          2);
+        }
+      else if (cursor_type == 2 && oldcursor.row >= 0)
+        {
+          XSetForeground (dpy, gc, pix_colors[ccol1]);
+          XFillRectangle (dpy, vt, gc,
+                          Col2Pixel (cur_col),
+                          Row2Pixel (oldcursor.row),
+                          2,
+                          Height2Pixel (1));
+        }
+      else if (focus)
+        {
+          scr_set_char_rend (ROW(screen.cur.row), cur_col, cur_rend);
         }
       else if (oldcursor.row >= 0)
         {
-- 
2.1.3


_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/rxvt-unicode

Reply via email to