about summary refs log tree commit diff stats
path: root/gemini.tlv
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-12-21 16:15:40 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-12-21 16:15:40 -0800
commitf689fb7bed5512fa20b803b90b783204cea05bef (patch)
treeb4b2eb3a02f0a64b4bc509ed47b80c0142cd7c3d /gemini.tlv
parent41bf615f4388076ce6256e694aa18926c08d3775 (diff)
downloadteliva-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.tlv7
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