Mercurial > hg > octave-max
diff liboctave/cmd-edit.cc @ 9485:3cee58bf4acf
selectively complete filenames in some cases
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 04 Aug 2009 16:31:15 -0400 |
parents | 9b87aeb24ea9 |
children | 4c0cdbe0acca |
line wrap: on
line diff
--- a/liboctave/cmd-edit.cc +++ b/liboctave/cmd-edit.cc @@ -139,6 +139,8 @@ string_vector do_generate_filename_completions (const std::string& text); + std::string do_get_line_buffer (void) const; + void do_insert_text (const std::string& text); void do_newline (void); @@ -506,6 +508,12 @@ return retval; } +std::string +gnu_readline::do_get_line_buffer (void) const +{ + return ::octave_rl_line_buffer (); +} + void gnu_readline::do_insert_text (const std::string& text) { @@ -737,6 +745,8 @@ string_vector do_generate_filename_completions (const std::string& text); + std::string do_get_line_buffer (void) const; + void do_insert_text (const std::string&); void do_newline (void); @@ -790,6 +800,12 @@ return string_vector (); } +std::string +default_command_editor::do_get_line_buffer (void) const +{ + return ""; +} + void default_command_editor::do_insert_text (const std::string&) { @@ -1119,6 +1135,12 @@ ? instance->do_generate_filename_completions (text) : string_vector (); } +std::string +command_editor::get_line_buffer (void) +{ + return (instance_ok ()) ? instance->do_get_line_buffer () : ""; +} + void command_editor::insert_text (const std::string& text) {