aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/utils.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/utils.c b/src/utils.c
index d18b8bc..243de4c 100755
--- a/src/utils.c
+++ b/src/utils.c
@@ -1,4 +1,4 @@
-/* $calcurse: utils.c,v 1.85 2010/10/23 10:25:53 culot Exp $ */
+/* $calcurse: utils.c,v 1.86 2010/11/04 10:55:07 fleischer Exp $ */
/*
* Calcurse - text-based organizer
@@ -362,6 +362,25 @@ getstring (WINDOW *win, char *str, int l, int x, int y)
printf ("\a");
break;
+ case CTRL ('W'): /* delete a word */
+ while (len > 0 && newpos > x && *(orig + newpos - 1) == ' ') {
+ --newpos;
+ --len;
+ if (newpos >= x + len)
+ --str;
+ else
+ del_char (newpos, orig);
+ }
+ while (len > 0 && newpos > x && *(orig + newpos - 1) != ' ') {
+ --newpos;
+ --len;
+ if (newpos >= x + len)
+ --str;
+ else
+ del_char (newpos, orig);
+ }
+ break;
+
case CTRL ('K'): /* delete to end-of-line */
str = orig + newpos;
*str = 0;