From 04fb4caf8f21b0d6161c0c07f4ce30d28ff7142b Mon Sep 17 00:00:00 2001 From: Quentin Hibon Date: Tue, 29 Aug 2017 19:57:23 +0200 Subject: Implement CTRL-U in getstring() Signed-off-by: Lukas Fleischer --- src/getstring.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/getstring.c b/src/getstring.c index 3809299..6dfb470 100644 --- a/src/getstring.c +++ b/src/getstring.c @@ -229,11 +229,17 @@ enum getstr getstring(WINDOW * win, char *str, int l, int x, int y) bell(); } break; + case CTRL('U'): /* delete to beginning of line */ + while (st.pos) { + st.pos--; + getstr_del_char(&st); + } + break; case CTRL('K'): /* delete to end-of-line */ st.s[st.ci[st.pos].offset] = 0; st.len = st.pos; break; - case CTRL('A'): /* go to begginning of string */ + case CTRL('A'): /* go to beginning of string */ st.pos = 0; break; case CTRL('E'): /* go to end of string */ -- cgit v1.2.3-70-g09d2