1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/readline/extconf.rb: checked rl_refresh_line in readline.

* ext/readline/readline.c (readline_s_refresh_line): add new
  method, a patch from Koichiro Ohba. see [ruby-list:45922].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kouji 2009-07-10 13:03:40 +00:00
parent 89fd521319
commit 257c314fbb
4 changed files with 31 additions and 0 deletions

View file

@ -1,3 +1,10 @@
Fri Jul 10 21:45:30 2009 TAKAO Kouji <kouji@takao7.net>
* ext/readline/extconf.rb: checked rl_refresh_line in readline.
* ext/readline/readline.c (readline_s_refresh_line): add new
method, a patch from Koichiro Ohba. see [ruby-list:45922].
Fri Jul 10 21:00:05 2009 TAKAO Kouji <kouji@takao7.net>
* ext/readline/extconf.rb: checked rl_line_buffer and rl_point in

View file

@ -50,6 +50,7 @@ have_readline_func("rl_getc_function")
have_readline_func("rl_filename_completion_function")
have_readline_func("rl_username_completion_function")
have_readline_func("rl_completion_matches")
have_readline_func("rl_refresh_line")
have_readline_var("rl_deprep_term_function")
have_readline_var("rl_completion_append_character")
have_readline_var("rl_basic_word_break_characters")

View file

@ -1043,6 +1043,26 @@ readline_s_get_filename_quote_characters(VALUE self, VALUE str)
#define readline_s_get_filename_quote_characters rb_f_notimplement
#endif
#ifdef HAVE_RL_REFRESH_LINE
/*
* call-seq:
* Readline.refresh_line -> nil
*
* Clear the current input line.
*
* Raises SecurityError exception if $SAFE is 4.
*/
static VALUE
readline_s_refresh_line(self)
{
rb_secure(4);
rl_refresh_line(0, 0);
return Qnil;
}
#else
#define readline_s_refresh_line rb_f_notimplement
#endif
static VALUE
hist_to_s(VALUE self)
{
@ -1350,6 +1370,8 @@ Init_readline()
readline_s_set_filename_quote_characters, 1);
rb_define_singleton_method(mReadline, "filename_quote_characters",
readline_s_get_filename_quote_characters, 0);
rb_define_singleton_method(mReadline, "refresh_line",
readline_s_refresh_line, 0);
history = rb_obj_alloc(rb_cObject);
rb_extend_object(history, rb_mEnumerable);

View file

@ -21,6 +21,7 @@ begin
"completer_quote_characters",
"filename_quote_characters=",
"filename_quote_characters",
"refresh_line",
].each do |method_name|
define_method(method_name.to_sym) do |*args|
raise NotImplementedError