Mercurial > hg
diff mcabber/src/screen.c @ 312:f0b7ff2df7e8
Ctrl-C does not terminate mcabber
1st Ctrl-C abort current completion
2 Ctrl-C in less than 2 seconds leave mcabber
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Thu, 14 Jul 2005 23:17:21 +0100 |
parents | 566818afee1c |
children | 1ceb68eb2fc1 |
line wrap: on
line diff
--- a/mcabber/src/screen.c Thu Jul 14 21:45:23 2005 +0100 +++ b/mcabber/src/screen.c Thu Jul 14 23:17:21 2005 +0100 @@ -1482,6 +1482,24 @@ } } +inline void refresh_inputline(void) +{ + mvwprintw(inputWnd, 0,0, "%s", inputLine + inputline_offset); + wclrtoeol(inputWnd); + if (*ptr_inputline) + wmove(inputWnd, 0, ptr_inputline - (char*)&inputLine - inputline_offset); +} + +void scr_handle_sigint(void) +{ + scr_LogPrint("In screen. completion_started=%d", completion_started); + // Same as Ctrl-g, now + scr_cancel_current_completion(); + scr_end_current_completion(); + check_offset(-1); + refresh_inputline(); +} + // process_key(key) // Handle the pressed key, in the command line (bottom). int process_key(int key) @@ -1647,14 +1665,8 @@ } if (completion_started && key != 9 && key != KEY_RESIZE) scr_end_current_completion(); - mvwprintw(inputWnd, 0,0, "%s", inputLine + inputline_offset); - wclrtoeol(inputWnd); - if (*ptr_inputline) { - wmove(inputWnd, 0, ptr_inputline - (char*)&inputLine - inputline_offset); - } - if (!update_roster) { - //update_panels(); + refresh_inputline(); + if (!update_roster) doupdate(); - } return 0; }