diff libinterp/interpfcn/input.cc @ 16382:389b09a914e2

allow gui to force readline to return from its idle/read loop * cmd-edit.h, cmd-edit.cc (command_editor::interrupt, command_editor::do_interrupt): New functions. (gnu_readline::do_interrupt): New function. * oct-rl-edit.h, oct-rl-edit.c (octave_rl_done): New function. * main-window.cc (main_window::debug_step_into_callback, main_window::debug_step_over_callback, main_window::debug_step_out_callback): Call command_editor::interrupt. * input.cc (get_debug_input): Reset command_editor::interrutp state. If previous state is true, then exit early.
author John W. Eaton <jwe@octave.org>
date Wed, 27 Mar 2013 20:29:06 -0400
parents f33dcbd6a005
children 3cacd597464d
line wrap: on
line diff
--- a/libinterp/interpfcn/input.cc
+++ b/libinterp/interpfcn/input.cc
@@ -554,15 +554,20 @@
 
       int retval = curr_parser.run ();
 
-      if (retval == 0 && curr_parser.stmt_list)
+      if (command_editor::interrupt (false))
+        break;
+      else
         {
-          curr_parser.stmt_list->accept (*current_evaluator);
+          if (retval == 0 && curr_parser.stmt_list)
+            {
+              curr_parser.stmt_list->accept (*current_evaluator);
 
-          if (octave_completion_matches_called)
-            octave_completion_matches_called = false;
+              if (octave_completion_matches_called)
+                octave_completion_matches_called = false;
+            }
+
+          octave_quit ();
         }
-
-      octave_quit ();
     }
 }