nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit af2f218192021a2d386caf8a437d247208c23e66
parent 572247dbd83c750346d8e070ff1b675b47e2c4f9
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 26 Jul 2024 11:14:17 +0200

bindings: at a Yes-No-All prompt, accept also ^A for "All"

This can be useful when replacing text in a Japanese locale,
avoiding the need to guide the input method to produce "A".

Inspired-by: Takeshi Hamasaki <hmatrjp@users.sourceforge.jp>

Diffstat:
Msrc/prompt.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/prompt.c b/src/prompt.c @@ -761,9 +761,11 @@ int ask_user(bool withall, const char *question) else if (kbinput == '\x0E' || (kbinput == '\x11' && !ISSET(MODERN_BINDINGS)) || (kbinput == '\x18' && ISSET(MODERN_BINDINGS))) choice = NO; - /* And interpret ^Y as "Yes". */ + /* Also, interpret ^Y as "Yes, and ^A as "All". */ else if (kbinput == '\x19') choice = YES; + else if (kbinput == '\x01' && withall) + choice = ALL; #ifdef ENABLE_MOUSE else if (kbinput == KEY_MOUSE) { int mouse_x, mouse_y;