diff liboctave/util/cmd-edit.cc @ 19412:f7ccd02bc060 gui-release

provide access to the readline variable rl_erase_empty_line * cmd-edit.h, cmd-edit.cc (command_editor::erase_empty_line, command_editor::do_erase_empty_line, gnu_readline::do_erase_empty_line): New functions. * oct-rl-edit.h, oct-rl-edit.c (octave_rl_erase_empty_line): New function.
author John W. Eaton <jwe@octave.org>
date Thu, 04 Dec 2014 15:56:49 -0500
parents 735bc47d18af
children 5db5619fe54e
line wrap: on
line diff
--- a/liboctave/util/cmd-edit.cc	Tue Dec 02 10:00:48 2014 -0500
+++ b/liboctave/util/cmd-edit.cc	Thu Dec 04 15:56:49 2014 -0500
@@ -108,6 +108,8 @@
 
   void do_blink_matching_paren (bool flag);
 
+  bool do_erase_empty_line (bool flag);
+
   void do_set_basic_word_break_characters (const std::string& s);
 
   void do_set_completer_word_break_characters (const std::string& s);
@@ -379,6 +381,12 @@
   ::octave_rl_enable_paren_matching (flag ? 1 : 0);
 }
 
+bool
+gnu_readline::do_erase_empty_line (bool flag)
+{
+  return ::octave_rl_erase_empty_line (flag ? 1 : 0);
+}
+
 void
 gnu_readline::do_set_basic_word_break_characters (const std::string& s)
 {
@@ -1177,6 +1185,12 @@
     instance->do_blink_matching_paren (flag);
 }
 
+bool
+command_editor::erase_empty_line (bool flag)
+{
+  return instance_ok () ? instance->do_erase_empty_line (flag) : false;
+}
+
 void
 command_editor::set_basic_word_break_characters (const std::string& s)
 {