comparison src/input.cc @ 5832:5e41e06f6a78

[project @ 2006-05-26 21:41:32 by jwe]
author jwe
date Fri, 26 May 2006 21:42:22 +0000
parents 080c08b192d8
children 44f24cf66b95
comparison
equal deleted inserted replaced
5831:b0d4ff99a0c5 5832:5e41e06f6a78
52 #include "dirfns.h" 52 #include "dirfns.h"
53 #include "error.h" 53 #include "error.h"
54 #include "gripes.h" 54 #include "gripes.h"
55 #include "help.h" 55 #include "help.h"
56 #include "input.h" 56 #include "input.h"
57 #include "load-path.h"
57 #include "oct-map.h" 58 #include "oct-map.h"
58 #include "oct-hist.h" 59 #include "oct-hist.h"
59 #include "toplev.h" 60 #include "toplev.h"
60 #include "oct-obj.h" 61 #include "oct-obj.h"
61 #include "pager.h" 62 #include "pager.h"
88 // 89 //
89 // more than one state can be active at once. 90 // more than one state can be active at once.
90 int Vecho_executing_commands = ECHO_OFF; 91 int Vecho_executing_commands = ECHO_OFF;
91 92
92 // The time we last printed a prompt. 93 // The time we last printed a prompt.
93 octave_time Vlast_prompt_time; 94 octave_time Vlast_prompt_time = 0.0;
94 95
95 // Character to append after successful command-line completion attempts. 96 // Character to append after successful command-line completion attempts.
96 static char Vcompletion_append_char = ' '; 97 static char Vcompletion_append_char = ' ';
97 98
98 // Global pointer for eval(). 99 // Global pointer for eval().
210 { 211 {
211 OCTAVE_QUIT; 212 OCTAVE_QUIT;
212 213
213 std::string retval; 214 std::string retval;
214 215
215 Vlast_prompt_time.stamp ();
216
217 if ((interactive || forced_interactive) 216 if ((interactive || forced_interactive)
218 && (! (reading_fcn_file || reading_script_file))) 217 && (! (reading_fcn_file
218 || reading_script_file
219 || input_from_startup_file
220 || input_from_command_line_file)))
219 { 221 {
220 std::string ps = (promptflag > 0) ? VPS1 : VPS2; 222 std::string ps = (promptflag > 0) ? VPS1 : VPS2;
221 223
222 std::string prompt = command_editor::decode_prompt_string (ps); 224 std::string prompt = command_editor::decode_prompt_string (ps);
223 225
225 227
226 flush_octave_stdout (); 228 flush_octave_stdout ();
227 229
228 octave_diary << prompt; 230 octave_diary << prompt;
229 231
232 Vlast_prompt_time.stamp ();
233
230 retval = gnu_readline (prompt); 234 retval = gnu_readline (prompt);
235
236 // There is no need to update the load_path cache if there is no
237 // user input.
238 if (! retval.empty ())
239 load_path::update ();
231 } 240 }
232 else 241 else
233 retval = gnu_readline (""); 242 retval = gnu_readline ("");
234 243
235 current_input_line = retval; 244 current_input_line = retval;