about summary refs log tree commit diff stats
path: root/termbox
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-05-13 20:47:07 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-05-13 20:48:16 -0700
commit27ec57de4cc5eddd80f9faf198c0cebc345c1949 (patch)
treef85ec7a45b31f71925775c2a11ef6ff34765cf15 /termbox
parent6f4ce8654319ec2d5099d5d01a63d8e2e5ea0c6f (diff)
downloadmu-27ec57de4cc5eddd80f9faf198c0cebc345c1949.tar.gz
3858
Lose the ability to hide the cursor. If we want to stop buffering the screen
in termbox, it needs to go.

What's more, it has no tests.
Diffstat (limited to 'termbox')
-rw-r--r--termbox/termbox.c7
-rw-r--r--termbox/termbox.h6
2 files changed, 3 insertions, 10 deletions
diff --git a/termbox/termbox.c b/termbox/termbox.c
index 0e0669ad..1ae275ce 100644
--- a/termbox/termbox.c
+++ b/termbox/termbox.c
@@ -30,7 +30,6 @@ struct cellbuf {
 };
 
 #define CELL(buf, x, y) (buf)->cells[(y) * (buf)->width + (x)]
-#define IS_CURSOR_HIDDEN(cx, cy) (cx == -1 || cy == -1)
 #define LAST_COORD_INIT -1
 
 static struct termios orig_tios;
@@ -202,8 +201,7 @@ void tb_present() {
       x += w;
     }
   }
-  if (!IS_CURSOR_HIDDEN(cursor_x, cursor_y))
-    write_cursor(cursor_x, cursor_y);
+  write_cursor(cursor_x, cursor_y);
   bytebuffer_flush(&output_buffer, inout);
 }
 
@@ -212,8 +210,7 @@ void tb_set_cursor(int cx, int cy)
   assert(termw != -1);
   cursor_x = cx;
   cursor_y = cy;
-  if (!IS_CURSOR_HIDDEN(cursor_x, cursor_y))
-    write_cursor(cursor_x, cursor_y);
+  write_cursor(cursor_x, cursor_y);
 }
 
 void tb_change_cell(int x, int y, uint32_t ch, uint16_t fg, uint16_t bg)
diff --git a/termbox/termbox.h b/termbox/termbox.h
index 4c5d327a..64c1c4eb 100644
--- a/termbox/termbox.h
+++ b/termbox/termbox.h
@@ -60,12 +60,8 @@ struct tb_cell *tb_cell_buffer();
 void tb_clear(void);
 void tb_set_clear_attributes(uint16_t fg, uint16_t bg);
 
-/* Move the cursor. Upper-left character is (0, 0).
- */
+/* Move the cursor. Upper-left character is (0, 0). */
 void tb_set_cursor(int cx, int cy);
-/* To hide the cursor, call tb_set_cursor(TB_HIDE_CURSOR, TB_HIDE_CURSOR).
- * Cursor starts out hidden. */
-#define TB_HIDE_CURSOR -1
 
 /* Modify a specific cell of the screen. Don't forget to call tb_present() to
  * commit your changes. */