From af6683a83baa69bd1a18abb7f2fbb8a58666f8b5 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 14 Nov 2016 15:33:09 -0500 Subject: [PATCH] only show cursor for currently focused view (tag or edit view) --- inc/edit.h | 1 + xedit.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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))); } -- 2.54.0