comparison libgui/src/octave-cmd.cc @ 19936:26281bc8d23b

fix non functioning ctrl-c when function executed from editor (bug #44397) * octave-cmd.cc (octave_cmd_eval::execute): use command-editor if function name is a valid identifier and Fsource if not
author Torsten <ttl@justmail.de>
date Wed, 04 Mar 2015 21:01:28 +0100
parents 19755f4fc851
children 3be09ebf2105
comparison
equal deleted inserted replaced
19935:ded81845c597 19936:26281bc8d23b
64 if (valid_identifier (function_name.toStdString ())) 64 if (valid_identifier (function_name.toStdString ()))
65 { 65 {
66 // valid identifier: call as function with possibility to debug 66 // valid identifier: call as function with possibility to debug
67 std::string path = _info.absolutePath ().toStdString (); 67 std::string path = _info.absolutePath ().toStdString ();
68 if (octave_qt_link::file_in_path (file_path, path)) 68 if (octave_qt_link::file_in_path (file_path, path))
69 Feval (ovl (function_name.toStdString ())); 69 command_editor::replace_line (function_name.toStdString ());
70 } 70 }
71 else 71 else
72 { 72 {
73 // no valid identifier: use Fsource (), no debug possible 73 // no valid identifier: use Fsource (), no debug possible
74 Fsource (ovl (file_path)); 74 Fsource (ovl (file_path));
75 command_editor::replace_line ("");
75 } 76 }
76 77
77 command_editor::replace_line ("");
78 command_editor::set_initial_input (pending_input); 78 command_editor::set_initial_input (pending_input);
79 command_editor::redisplay (); 79 command_editor::redisplay ();
80 80
81 command_editor::interrupt (); 81 command_editor::interrupt ();
82 } 82 }