From 41d80b5b145410b453c5b7536293363acff79fbf Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 8 Dec 2024 08:12:19 +0100 Subject: [PATCH] Calling Ctrl-U should delete from cursor to beginning Fixes #71 Signed-off-by: Joachim Wiberg --- src/editline.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/editline.c b/src/editline.c index 350b5cb..d74e225 100644 --- a/src/editline.c +++ b/src/editline.c @@ -1159,6 +1159,8 @@ static el_status_t emacs(int c) static el_status_t tty_special(int c) { + el_status_t rc; + #ifdef CONFIG_SIGINT if (c == rl_intr) { el_intr_pending = SIGINT; @@ -1183,14 +1185,10 @@ static el_status_t tty_special(int c) return bk_del_char(); if (c == rl_kill) { - if (rl_point != 0) { - old_point = rl_point; - rl_point = 0; - reposition(c); - } - Repeat = NO_ARG; - - return kill_line(); + Repeat = rl_point; + rc = bk_del_char(); + Repeat = NO_ARG; + return rc; } #ifdef CONFIG_EOF