diff liboctave/util/cmd-edit.h @ 21798:12e7456f7619

Tab completion of multiple directory levels. (bug #44095) * cmd-edit.h, cmd-edit.cc (gnu_readline::completer_quote_characters): New static data member. (gnu_readline::completion_hook_fcn): New typedef. (looks_like_filename): New static function. (gnu_readline::do_set_completer_quote_characters): Set octave_quote_characters instead of calling octave_rl_set_completer_quote_characters directly. (gnu_readline::do_completer_word_break_hook): New static function. (gnu_readline::do_set_completer_word_break_hook): New function. (gnu_readline::do_set_completer_word_break_characters): Also set completer_word_break_hook. * oct-rl-edit.h, oct-rl-edit.c (rl_completion_hook_fcn_ptr): New typedef. (octave_rl_get_completer_word_break_characters, octave_rl_set_completion_word_break_hook): New functions.
author Lachlan Andrew <lachlanbis@gmail.com>
date Tue, 31 May 2016 12:51:52 +1000
parents 949cb46e6bdb
children 5c67b16acc4a
line wrap: on
line diff
--- a/liboctave/util/cmd-edit.h	Mon May 30 10:44:24 2016 -0400
+++ b/liboctave/util/cmd-edit.h	Tue May 31 12:51:52 2016 +1000
@@ -53,6 +53,8 @@
 
     typedef std::string (*completion_fcn) (const std::string&, int);
 
+    typedef char * (*completion_hook_fcn) ();
+
     typedef std::string (*quoting_fcn) (const std::string&, int, char);
 
     typedef std::string (*dequoting_fcn) (const std::string&, int);
@@ -276,6 +278,8 @@
 
     virtual void do_set_completer_word_break_characters (const std::string&) { }
 
+    virtual void do_set_completer_word_break_hook (completion_hook_fcn) { }
+
     virtual void do_set_basic_quote_characters (const std::string&) { }
 
     virtual void do_set_filename_quote_characters (const std::string&) { }