zygo

ncurses gopher client
Log | Files | Refs

commit d7221fdbfa4be999fb79dc625c39476e09c5b517
parent d5c3e2bc767762bfde05b2c4fd1790a8958ada7f
Author: hhvn <dev@hhvn.uk>
Date:   Thu, 23 Jun 2022 16:25:13 +0100

Remove ui.candraw

Diffstat:
Mzygo.c | 20+++-----------------
1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/zygo.c b/zygo.c @@ -54,12 +54,10 @@ struct { regex_t regex; int error; char errorbuf[BUFLEN]; - int candraw; } ui = {.scroll = 0, .wantinput = 0, .search = 0, - .error = 0, - .candraw = 1}; + .error = 0}; /* * Memory functions @@ -715,11 +713,7 @@ draw_page(void) { int nwidth; Elem *e; - if (!ui.candraw) - return; - attroff(A_COLOR); - if (page) { if (!current || current->type != '0') nwidth = digits(page->lastid); @@ -741,9 +735,6 @@ void draw_bar(void) { int savey, savex, x; - if (!ui.candraw) - return; - move(LINES - 1, 0); clrtoeol(); if (current) { @@ -959,15 +950,10 @@ run(void) { draw_page(); draw_bar(); - /* get_wch does refresh() for us */ while ((ret = get_wch(&c)) != ERR) { - if (!ui.candraw || ui.error) { - ui.candraw = 1; + if (ui.error && c != KEY_RESIZE) ui.error = 0; - draw_page(); - draw_bar(); - } if (c == KEY_RESIZE) { draw_page(); @@ -990,7 +976,7 @@ submit: clrtoeol(); printw("%s", elemtouri(list_idget(&page, atoi(ui.arg)))); curs_set(0); - ui.candraw = 0; + getch(); /* wait */ } break; case BIND_SEARCH: