]> git.mdlowis.com Git - projs/tide.git/commitdiff
Fixed tab handling for scrolling and changed cursor to highlight full width of the... screen-buf
authorMike Lowis <mike.lowis@gentex.com>
Tue, 4 Oct 2016 15:11:43 +0000 (11:11 -0400)
committerMike Lowis <mike.lowis@gentex.com>
Tue, 4 Oct 2016 15:11:43 +0000 (11:11 -0400)
xedit.c

diff --git a/xedit.c b/xedit.c
index 108c42e20cdb2159b97845c52e3dc386ab837a8d..807109504aa1746aebf61c374281846463490bf0 100644 (file)
--- a/xedit.c
+++ b/xedit.c
@@ -119,6 +119,7 @@ static void handle_key(XEvent* e) {
         case XK_F1:
             InsertMode = !InsertMode;
             break;
+
         case XK_F6:
             ColorBase = !ColorBase;
             break;
@@ -217,7 +218,7 @@ static void scroll_dn(void) {
             for (unsigned x = 0; x < ncols; x++) {
                 Rune r = buf_get(&Buffer, pos++);
                 if (r == '\n') { break; }
-                if (r == '\t') { x += 4; break; }
+                if (r == '\t') { x += 4; }
             }
         }
         EndPos = pos-1;
@@ -280,7 +281,10 @@ static void redraw(void) {
     if (InsertMode) {
         XftDrawRect(X.xft, &csrclr, csrx * fwidth, csry * fheight + X.font->descent, 2, fheight);
     } else {
-        XftDrawRect(X.xft, &csrclr, csrx * fwidth, csry * fheight + X.font->descent, fwidth, fheight);
+        unsigned width = 1;
+        if ('\t' == buf_get(&Buffer, CursorPos))
+            width = TabWidth - (csrx % TabWidth);
+        XftDrawRect(X.xft, &csrclr, csrx * fwidth, csry * fheight + X.font->descent, width * fwidth, fheight);
         XftDrawString32(X.xft, &bkgclr, X.font, csrx * fwidth, (csry+1) * fheight, (FcChar32*)&csrrune, 1);
     }