diff options
author | toni <matzeton@googlemail.com> | 2014-12-07 20:48:22 +0100 |
---|---|---|
committer | toni <matzeton@googlemail.com> | 2014-12-07 21:37:35 +0100 |
commit | 100504b25d93d669cd85ce1f5a0326018f1c9811 (patch) | |
tree | 3a62a7321b3a486e1382101b7779988c9c93ad01 | |
parent | 201120f8ceade9d69ee25b80d4f7174c12c4c88b (diff) | |
parent | 2fa089d6dcf8434ba790005a1a7f0aa1fe198fb0 (diff) |
Merge branch 'master' of github.com:freecoding/naskpass
-rw-r--r-- | ui.h | 5 | ||||
-rw-r--r-- | ui_input.c | 9 |
2 files changed, 11 insertions, 3 deletions
@@ -6,9 +6,8 @@ #define UICB_OK 0 #define UICB_ERR_UNDEF 1 -#define UICB_ERR_NOP 2 -#define UICB_ERR_CB 3 -#define UICB_ERR_BUF 4 +#define UICB_ERR_CB 2 +#define UICB_ERR_BUF 3 #define UILOOP_TIMEOUT 1 @@ -104,6 +104,15 @@ add_input(WINDOW *win, struct input *a, int key) int del_input(WINDOW *win, struct input *a) { + if (a == NULL) return (UICB_ERR_UNDEF); + memmove((a->input + a->input_pos - 1), (a->input + a->input_pos), a->input_max - a->input_pos); + --a->input_len; + if (a->input_pos == a->input_len) { + --a->input_pos; + } + print_input(win, a); + mvwprintw(win, 10, 1, "w:%d,cp:%d,im:%lu,il:%lu,ip:%lu,s:%s", a->width, a->cur_pos, a->input_max, a->input_len, a->input_pos, a->input); + return (UICB_OK); } |