]> git.mdlowis.com Git - projs/tide.git/commitdiff
only show cursor for currently focused view (tag or edit view)
authorMichael D. Lowis <mike.lowis@gentex.com>
Mon, 14 Nov 2016 20:33:09 +0000 (15:33 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Mon, 14 Nov 2016 20:33:09 +0000 (15:33 -0500)
inc/edit.h
xedit.c

index 14ea1a070c40b05e343e53651ff3bb120615d23a..2f42f6c957a302926d9db18baef85c1fa4a881f6 100644 (file)
@@ -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 8b9d3091919db3b3c866868f93d8c13d2ef17b8a..0a3bf672bef1e750bc2da5de28b1b5251293df11 100644 (file)
--- 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)));
 }