iomenu

interactive text selection menu
Log | Files | Refs | README | LICENSE

commit d039d19d82cc89665d453180d25007bf2329c3e6
parent e01fa60f7992641ba6f3f5109dec6783e397a248
Author: Josuah Demangeonā  ā µ <mail@josuah.net>
Date:   Tue,  4 Apr 2017 00:07:11 +0200

C-j for printing input rather than the candidate.

Diffstat:
Miomenu.1 | 5++++-
Miomenu.c | 4++++
2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/iomenu.1 b/iomenu.1 @@ -52,9 +52,12 @@ An active selection is highlighted, and can be controlled with keybindings. .It Ic ^P Ns , Ic ^N Move selection to the previous/next item. . -.It Ic ^M Ns , Ic ^J Ns , Ic Enter +.It Ic ^M Ns , Ic Enter Print the selection to the standard output, and exit 0. . +.It Ic ^J +Print the current input to the standard output, and exit 0. +. .It Ic ^Y Print the selection to the standard output but .Sy continue running . diff --git a/iomenu.c b/iomenu.c @@ -413,6 +413,10 @@ input_key(void) break; case CONTROL('J'): + fputws(input, stdout); + putwchar('\n'); + return EXIT_SUCCESS; + case CONTROL('M'): /* enter */ print_selection(); return EXIT_SUCCESS;