diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-12-21 16:15:40 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-12-21 16:15:40 -0800 |
commit | f689fb7bed5512fa20b803b90b783204cea05bef (patch) | |
tree | b4b2eb3a02f0a64b4bc509ed47b80c0142cd7c3d /gemini.tlv | |
parent | 41bf615f4388076ce6256e694aa18926c08d3775 (diff) | |
download | teliva-f689fb7bed5512fa20b803b90b783204cea05bef.tar.gz |
gemini: slightly cleaner rendering of owner input
This still only works if I remove the call to `refresh()` inside `Wgetch()`. With that call no keystrokes are displayed. Looks like ncurses doesn't include user input when refreshing the window. Unclear if there's an easy way to support that while keeping the menu visible.
Diffstat (limited to 'gemini.tlv')
-rw-r--r-- | gemini.tlv | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gemini.tlv b/gemini.tlv index a8e228e..69abfbb 100644 --- a/gemini.tlv +++ b/gemini.tlv @@ -203,8 +203,15 @@ >function edit_line(window) > local result = '' > local cursor = 1 + > local screen_rows, screen_cols = window:getmaxyx() > while true do + > window:mvaddstr(screen_rows-1, 9, '') + > window:clrtoeol() + > window:mvaddstr(screen_rows-1, 9, result) + > window:attron(curses.A_REVERSE) + > -- window:refresh() > local key = curses.getch() + > window:attrset(curses.A_NORMAL) > if key >= 32 and key < 127 then > local screen_rows, screen_cols = window:getmaxyx() > if #result < screen_cols then |