From 0352ae31073a8870e8bd4d2cb031c4caa4ceced8 Mon Sep 17 00:00:00 2001 From: Frederic Culot Date: Wed, 28 Feb 2007 21:29:05 +0000 Subject: bugfix: CTRL-D problems while editing item fixed. Thanks Toucouch for reporting it. --- src/utils.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/utils.c b/src/utils.c index d475b8f..078b302 100755 --- a/src/utils.c +++ b/src/utils.c @@ -1,4 +1,4 @@ -/* $calcurse: utils.c,v 1.21 2007/01/16 07:55:18 culot Exp $ */ +/* $calcurse: utils.c,v 1.22 2007/02/28 21:29:05 culot Exp $ */ /* * Calcurse - text-based organizer @@ -216,8 +216,14 @@ int getstring(WINDOW *win, int colr, char *str, int l, int x, int y) break; case CTRL('D'): /* delete next character */ - --len; - del_char(newpos, orig); + if (newpos != (x + len)) { + --len; + if (newpos >= x + len) + --str; + else + del_char(newpos, orig); + } else + printf("\a"); break; case CTRL('K'): /* delete to end-of-line */ -- cgit v1.2.3-70-g09d2