Mercurial > hg > nnchat
diff ui.c @ 700:f3ec1cb11cea
Trim whitespace.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 17 Jan 2020 20:03:41 +0200 |
parents | 6fa9c36d0634 |
children | f3b119599b3a |
line wrap: on
line diff
--- a/ui.c Fri Jan 17 19:30:48 2020 +0200 +++ b/ui.c Fri Jan 17 20:03:41 2020 +0200 @@ -120,7 +120,7 @@ chatWindows[0] = nn_window_new(NULL); nn_log_open(chatWindows[0]); currWin = chatWindows[0]; - + return TRUE; } @@ -225,7 +225,7 @@ *col = A_DIM | COLOR_PAIR(val); else if (val < 30) *col = A_BOLD | COLOR_PAIR(val - 9); - + return TRUE; } @@ -244,7 +244,7 @@ (*buf)[*len] = ((unsigned char) ch) | color; (*len)++; - + return TRUE; } @@ -253,10 +253,10 @@ { const char *s = fmt; int col = 0; - + if (win == NULL) return -16; - + while (*s) { if (win->line == NULL) @@ -351,7 +351,7 @@ // Save cursor position getyx(stdscr, sy, sx); } - + // Check if update is forced or if the window is dirty if (currWin != NULL && (force || currWin->dirty)) { @@ -410,7 +410,7 @@ " ½10½%s½13½ | ½16½%s½13½ | ½11½#%06x½13½ | WIN: %d: %s / %d | ½11½", tmpStamp, username, - usercolor, + usercolor, currWin->num + 1, currWin->id != NULL ? currWin->id : "MAIN", currWin->pos); @@ -424,7 +424,7 @@ (currWin != NULL && currWin->id != NULL) ? currWin->id : "MAIN", currWin != NULL ? currWin->pos : 0); #endif - + wmove(stdscr, scrHeight - 4, 0); wbkgdset(stdscr, COLOR_PAIR(10)); wclrtoeol(stdscr); @@ -438,7 +438,7 @@ waddstr(stdscr, tmpStr); } } - + // Restore cursor position wmove(stdscr, sy, sx); } @@ -482,13 +482,13 @@ BOOL (*callback)(int, nn_editbuf_t *, nn_editstate_t *)) { int c, cnt = 0; - + // Handle several buffered keypresses at once do { c = wgetch(stdscr); - - /* Handle various problematic cases where terminal + + /* Handle various problematic cases where terminal * keycodes do not get properly translated by curses */ if (c == 10 || c == 13) @@ -683,14 +683,14 @@ { nnwin_input_process(editBuf, editState, callback); update(editBuf, editState); - } - + } + if (allowEmpty || editBuf->len > 0) res = nn_editbuf_get_string(editBuf, 0, editBuf->len); else res = NULL; nn_editbuf_free(editBuf); - + return res; }