From: Michael D. Lowis Date: Mon, 14 Nov 2016 20:33:09 +0000 (-0500) Subject: only show cursor for currently focused view (tag or edit view) X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=af6683a83baa69bd1a18abb7f2fbb8a58666f8b5;p=projs%2Ftide.git only show cursor for currently focused view (tag or edit view) --- diff --git a/inc/edit.h b/inc/edit.h index 14ea1a0..2f42f6c 100644 --- a/inc/edit.h +++ b/inc/edit.h @@ -150,6 +150,7 @@ typedef struct { void view_init(View* view, char* file); void view_resize(View* view, size_t nrows, size_t ncols); +//void view_resize(View* view, size_t x, size_t y, size_t height, size_t width, size_t fheight, size_t fwidth); void view_update(View* view, size_t* csrx, size_t* csry); Row* view_getrow(View* view, size_t row); void view_byrune(View* view, int move); diff --git a/xedit.c b/xedit.c index 8b9d309..0a3bf67 100644 --- a/xedit.c +++ b/xedit.c @@ -183,7 +183,8 @@ static size_t draw_view(size_t off, View* view, size_t rows, size_t width) { draw_glyphs(2, off + ((y+1) * fheight), row->cols, row->rlen, row->len); } /* Place cursor on screen */ - x11_draw_rect(CLR_BASE3, 2 + csrx * fwidth, off + (csry * fheight), 1, fheight); + if (view == Focused) + x11_draw_rect(CLR_BASE3, 2 + csrx * fwidth, off + (csry * fheight), 1, fheight); return (off + 4 + (rows * x11_font_height(Font))); }