From: Andreas Obergrusberger Date: Sun, 26 Aug 2007 19:28:30 +0000 (+0000) Subject: fixed 0001496 X-Git-Tag: v0.12_alpha1~335 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6e3f91f094c0c95036e11a4f070494ab850c3a6d;p=ncmpc.git fixed 0001496 git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@6817 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- diff --git a/src/wreadln.c b/src/wreadln.c index 8694bb3..fd65332 100644 --- a/src/wreadln.c +++ b/src/wreadln.c @@ -38,6 +38,7 @@ #define KEY_CTRL_E 5 #define KEY_CTRL_G 7 #define KEY_CTRL_K 11 +#define KEY_CTRL_U 21 #define KEY_CTRL_Z 26 #define KEY_BCKSPC 8 #define TAB 9 @@ -279,6 +280,12 @@ _wreadln(WINDOW *w, case KEY_CTRL_K: line[cursor] = 0; break; + case KEY_CTRL_U: + cursor = my_strlen(line); + for (i = 0;i < cursor; i++) + line[i] = '\0'; + cursor = 0; + break; case 127: case KEY_BCKSPC: /* handle backspace: copy all */ case KEY_BACKSPACE: /* chars starting from curpos */ @@ -702,6 +709,12 @@ _wreadln(WINDOW *w, case KEY_CTRL_K: wline[cursor] = 0; break; + case KEY_CTRL_U: + cursor = wcslen(wline); + for (i = 0;i < cursor; i++) + wline[i] = '\0'; + cursor = 0; + break; case KEY_CTRL_Z: sigstop(); break;