From: Mike Lowis Date: Tue, 4 Oct 2016 15:11:43 +0000 (-0400) Subject: Fixed tab handling for scrolling and changed cursor to highlight full width of the... X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=3a6003fa0fac6db4f1feb0077b9c429b5c25320f;p=projs%2Ftide.git Fixed tab handling for scrolling and changed cursor to highlight full width of the tab character --- diff --git a/xedit.c b/xedit.c index 108c42e..8071095 100644 --- 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); }