Mercurial > octave
diff liboctave/util/cmd-edit.cc @ 19702:c048358da712
also kill pending input line when gui command window is cleared (bug #44015)
* oct-rl-edit.h, oct-rl-edit.c (octave_rl_kill_full_line): New function.
* cmd-edit.h, cmd-edit.cc (command_editor::kill_full_line,
command_editor::do_kill_full_line, gnu_readline::do_kill_full_line,
default_command_editor::do_kill_full_line): New functions.
* main-window.cc (main_window::clear_command_window_callback):
Kill pending input line before clearing screen.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 12 Feb 2015 14:32:01 -0500 |
parents | 4197fc428c7d |
children | d6652461dfbc |
line wrap: on
line diff
--- a/liboctave/util/cmd-edit.cc Thu Feb 12 14:12:43 2015 -0500 +++ b/liboctave/util/cmd-edit.cc Thu Feb 12 14:32:01 2015 -0500 @@ -151,6 +151,8 @@ void do_replace_line (const std::string& text, bool clear_undo); + void do_kill_full_line (void); + void do_insert_text (const std::string& text); void do_newline (void); @@ -572,6 +574,12 @@ } void +gnu_readline::do_kill_full_line (void) +{ + ::octave_rl_kill_full_line (); +} + +void gnu_readline::do_insert_text (const std::string& text) { ::octave_rl_insert_text (text.c_str ()); @@ -841,6 +849,8 @@ void do_replace_line (const std::string& text, bool clear_undo); + void do_kill_full_line (void); + void do_insert_text (const std::string& text); void do_newline (void); @@ -920,6 +930,12 @@ } void +default_command_editor::do_kill_full_line (void) +{ + // FIXME +} + +void default_command_editor::do_insert_text (const std::string&) { // FIXME @@ -1330,6 +1346,13 @@ } void +command_editor::kill_full_line (void) +{ + if (instance_ok ()) + instance->do_kill_full_line (); +} + +void command_editor::insert_text (const std::string& text) { if (instance_ok ())