summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Hibon <qh.public@yahoo.com>2017-08-29 19:57:23 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2017-08-29 20:14:39 +0200
commit04fb4caf8f21b0d6161c0c07f4ce30d28ff7142b (patch)
treeafb71038b4be48d2b1ad899e1a474fa581d3e513
parent26aeddd4904ec6d21c80159734516a1690c189e9 (diff)
downloadcalcurse-04fb4caf8f21b0d6161c0c07f4ce30d28ff7142b.tar.gz
calcurse-04fb4caf8f21b0d6161c0c07f4ce30d28ff7142b.zip
Implement CTRL-U in getstring()
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r--src/getstring.c8
1 files changed, 7 insertions, 1 deletions
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 */