# HG changeset patch # User John W. Eaton # Date 1235409945 18000 # Node ID c743891156104dc3be5df713c35edc3ab48855d8 # Parent c690e37725839344fb2579ccf5dc68ef9f04a1d3 auto repeat for debugging commands diff -r c690e3772583 -r c74389115610 src/ChangeLog --- a/src/ChangeLog Mon Feb 23 14:54:56 2009 +0100 +++ b/src/ChangeLog Mon Feb 23 12:25:45 2009 -0500 @@ -1,3 +1,9 @@ +2009-02-23 John W. Eaton + + * input.cc (last_debugging_command): New static variable. + (octave_gets): Set it here. Don't insert repeated debugging + commands in the history list. + 2009-02-23 Jaroslav Hajek * DLD-FUNCTIONS/pinv.cc: Support diagonal and permutation matrices. diff -r c690e3772583 -r c74389115610 src/input.cc --- a/src/input.cc Mon Feb 23 14:54:56 2009 +0100 +++ b/src/input.cc Mon Feb 23 12:25:45 2009 -0500 @@ -149,6 +149,10 @@ // TRUE if we are in debugging mode. bool Vdebugging = false; +// If we are in debugging mode, this is the last command entered, so +// that we can repeat the previous command if the user just types RET. +static std::string last_debugging_command; + // TRUE if we are running in the Emacs GUD mode. static bool Vgud_mode = false; @@ -251,6 +255,8 @@ std::string retval; + bool history_skip_auto_repeated_debugging_command = false; + if ((interactive || forced_interactive) && (! (reading_fcn_file || reading_script_file @@ -273,7 +279,19 @@ // user input. if (! retval.empty () && retval.find_first_not_of (" \t\n\r") != std::string::npos) - load_path::update (); + { + load_path::update (); + + if (Vdebugging) + last_debugging_command = retval; + else + last_debugging_command = std::string (); + } + else if (Vdebugging) + { + retval = last_debugging_command; + history_skip_auto_repeated_debugging_command = true; + } } else retval = gnu_readline (""); @@ -282,7 +300,8 @@ if (! current_input_line.empty ()) { - if (! (input_from_startup_file || input_from_command_line_file)) + if (! (input_from_startup_file || input_from_command_line_file + || history_skip_auto_repeated_debugging_command)) command_history::add (current_input_line); if (! (reading_fcn_file || reading_script_file))