From d818efb7c824ffcfe7e62384cd70ef1b7aa098a8 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 18 Dec 2021 09:32:37 -0800 Subject: [PATCH] pay more attention to where we display the cursor It's still just in app control; I'm resisting the urge to introduce "smarts". --- life.tlv | 1 + src/lua.c | 3 ++- toot-toot.tlv | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/life.tlv b/life.tlv index 2abfd08..606aca5 100644 --- a/life.tlv +++ b/life.tlv @@ -31,6 +31,7 @@ >window = curses.stdscr() >-- animation-based app >window:nodelay(true) + >curses.curs_set(0) >lines, cols = window:getmaxyx() - __teliva_timestamp: original grid_char: diff --git a/src/lua.c b/src/lua.c index d40c716..c46f9c4 100644 --- a/src/lua.c +++ b/src/lua.c @@ -1042,7 +1042,8 @@ void developer_mode (lua_State *L) { init_pair(COLOR_PAIR_LUA_CONSTANT, COLOR_LUA_CONSTANT, COLOR_BACKGROUND); init_pair(COLOR_PAIR_MATCH, COLOR_MATCH_FOREGROUND, COLOR_MATCH_BACKGROUND); init_pair(COLOR_PAIR_ERROR, COLOR_ERROR_FOREGROUND, COLOR_ERROR_BACKGROUND); - nodelay(stdscr, 0); /* make getch() block */ + nodelay(stdscr, 0); /* always make getch() block in developer mode */ + curs_set(1); /* always display cursor in developer mode */ int switch_to_big_picture_view = 1; if (editor_view_in_progress(L)) switch_to_big_picture_view = restore_editor_view(L); diff --git a/toot-toot.tlv b/toot-toot.tlv index ecef55c..ce7b2bd 100644 --- a/toot-toot.tlv +++ b/toot-toot.tlv @@ -147,6 +147,7 @@ - __teliva_timestamp: original window: >window = curses.stdscr() + >curses.curs_set(0) -- we'll simulate our own cursor - __teliva_timestamp: original render: >function render(window)