commit f0032ce63b4f4f035e5f7894a406a96931f99f3f from: Mark Jamsek date: Sat Jul 02 04:09:20 2022 UTC tog: remove count prefix timeout and bold output Suggested by naddy. block till non-numeric input is entered, and don't echo in bold. ok naddy@ op@ and stsp@ commit - 76364b2d0d2a4cbd30e348da2a4330a2137ee86e commit + f0032ce63b4f4f035e5f7894a406a96931f99f3f blob - ed0412fd13daaa1ea18139730716db483ba49274 blob + 18d37fe0f1b21d153863f1bcf024ecca990a307a --- tog/tog.1 +++ tog/tog.1 @@ -58,12 +58,10 @@ provides global and command-specific key bindings and Some command-specific key bindings may be prefixed with an integer, which is denoted by N in the descriptions below, and is used as a modifier to the operation as indicated. -When the first integer for a count modifier is entered, .Nm -will wait 500 milliseconds for each successive integer or the compound sequence -to complete. -If this sequence should timeout or does not conclude with a valid key binding, -the command is aborted and any preceding count is reset. +will echo digits to the screen when count modifiers are entered, and complete +the sequence upon input of the first non-numeric character. +Count modifiers can be aborted by entering an unmapped key. The global key bindings are: .Bl -tag -width Ds .It Cm Q blob - a0eb6888febf2682be968a5bf8356432f985c690 blob + 9cc2f49357acdfea63b9c2c89ad3b280d9054d53 --- tog/tog.c +++ tog/tog.c @@ -997,10 +997,8 @@ view_search_start(struct tog_view *view) } /* - * Compute view->count from numeric user input. User has five-tenths of a - * second to follow each numeric keypress with another number to form count. - * Return first non-numeric input or ERR and assign total to view->count. - * XXX Should we add support for user-defined timeout? + * Compute view->count from numeric input. Assign total to view->count and + * return first non-numeric key entered. */ static int get_compound_key(struct tog_view *view, int c) @@ -1015,8 +1013,7 @@ get_compound_key(struct tog_view *view, int c) v = view->parent; view->count = 0; - halfdelay(5); /* block for half a second */ - wattron(v->window, A_BOLD); + cbreak(); /* block for input */ wmove(v->window, v->nlines - 1, 0); wclrtoeol(v->window); waddch(v->window, ':'); @@ -1041,8 +1038,6 @@ get_compound_key(struct tog_view *view, int c) /* Massage excessive or inapplicable values at the input handler. */ view->count = n; - wattroff(v->window, A_BOLD); - cbreak(); /* return to blocking */ return c; }