Mercurial > hg > nnchat
changeset 506:8734a02a86ec
Improve prompt function.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 02 Jun 2012 23:33:06 +0300 |
parents | 12939e665e49 |
children | e644d373afb9 |
files | ui.c |
diffstat | 1 files changed, 6 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/ui.c Sat Jun 02 22:38:47 2012 +0300 +++ b/ui.c Sat Jun 02 23:33:06 2012 +0300 @@ -285,19 +285,17 @@ char *nnwin_prompt_requester(const char *info, BOOL allowEmpty) { - char tmpBuf[512], *ptr; - int curSave = curs_set(1); + char buf[512], *ptr; echo(); + wattrset(stdscr, A_NORMAL); + wbkgdset(stdscr, COLOR_PAIR(0)); waddstr(stdscr, info); - wgetnstr(stdscr, tmpBuf, sizeof(tmpBuf) - 1); + wgetnstr(stdscr, buf, sizeof(buf) - 1); noecho(); - if (curSave != ERR) - curs_set(curSave); - - str_trim_right(tmpBuf); - ptr = str_trim_left(tmpBuf); + str_trim_right(buf); + ptr = str_trim_left(buf); if (allowEmpty || ptr[0]) return th_strdup(ptr);