From e5ed89646be2a8242dad028e1eaa4241d4f1dda3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?=
Date: Thu, 28 Oct 2021 08:18:15 +0200 Subject: [PATCH] xC: fix newer libedit (2021-08-29) --- xC.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/xC.c b/xC.c index 6bba09a..6264b8c 100644 --- a/xC.c +++ b/xC.c @@ -771,24 +771,13 @@ struct input_el static void app_editline_init (struct input_el *self); -static int -input_el__get_termios (int character, int fallback) -{ - if (!g_terminal.initialized) - return fallback; - - cc_t value = g_terminal.termios.c_cc[character]; - if (value == _POSIX_VDISABLE) - return fallback; - return value; -} - static void input_el__redisplay (void *input) { - // See rl_redisplay() + // See rl_redisplay(), however NetBSD editline's map.c v1.54 breaks VREPRINT + // so we bind redisplay somewhere else in app_editline_init() struct input_el *self = input; - char x[] = { input_el__get_termios (VREPRINT, 'R' - 0x40), 0 }; + char x[] = { 'q' & 31, 0 }; el_push (self->editline, x); // We have to do this or it gets stuck and nothing is done @@ -13782,6 +13771,8 @@ app_editline_init (struct input_el *self) CALL_ (input, bind_control, 'w', "ed-delete-prev-word"); // Just what are you doing? CALL_ (input, bind_control, 'u', "vi-kill-line-prev"); + // See input_el__redisplay(), functionally important + CALL_ (input, bind_control, 'q', "ed-redisplay"); // We need to hide the prompt and input first CALL_ (input, bind, "\n", "send-line");