From cf4d82e60e23c1a6a457c2df0b9b4c8afef40bef Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Thu, 28 Sep 2006 13:54:35 +0200 Subject: [PATCH] Hardwire ERR to mean REQ_NONE in the main loop Organization: Straylight/Edgeware From: Jonas Fonseca --- tig.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tig.c b/tig.c index 6c2b7d0..8ccce74 100644 --- a/tig.c +++ b/tig.c @@ -730,9 +730,6 @@ static struct keybinding default_keybindings[] = { { 'g', REQ_TOGGLE_REV_GRAPH }, { ':', REQ_PROMPT }, - /* wgetch() with nodelay() enabled returns ERR when there's no input. */ - { ERR, REQ_NONE }, - /* Using the ncurses SIGWINCH handler. */ { KEY_RESIZE, REQ_SCREEN_RESIZE }, }; @@ -3531,8 +3528,13 @@ main(int argc, char *argv[]) /* Refresh, accept single keystroke of input */ key = wgetch(status_win); - if (key == ERR) + + /* wgetch() with nodelay() enabled returns ERR when there's no + * input. */ + if (key == ERR) { + request = REQ_NONE; continue; + } request = get_keybinding(display[current_view]->keymap, key); -- [mdw]