diff mcabber/src/screen.c @ 314:1ceb68eb2fc1

Merge Ctrl-C stuff
author Mikael Berthe <mikael@lilotux.net>
date Thu, 14 Jul 2005 23:24:22 +0100
parents 566818afee1c f0b7ff2df7e8
children 65aa05520556 da138cdebf04
line wrap: on
line diff
--- a/mcabber/src/screen.c	Thu Jul 14 23:21:52 2005 +0100
+++ b/mcabber/src/screen.c	Thu Jul 14 23:24:22 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;
 }