зеркало из https://github.com/github/ruby.git
* ext/readline/readline.c: add new methods:
Readline::completion_append_character and Readline::completion_append_character=.k git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
058888bd38
Коммит
0c92a85e6a
|
@ -1,3 +1,9 @@
|
|||
Tue Jun 19 18:19:30 2001 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* ext/readline/readline.c: add new methods:
|
||||
Readline::completion_append_character and
|
||||
Readline::completion_append_character=.
|
||||
|
||||
Tue Jun 19 16:29:50 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (svalue_to_mvalue): new function to convert from svalue
|
||||
|
|
5
doc/NEWS
5
doc/NEWS
|
@ -1,3 +1,8 @@
|
|||
: Readline::completion_append_characte
|
||||
: Readline::completion_append_character=
|
||||
|
||||
Added.
|
||||
|
||||
: Proc#yield
|
||||
|
||||
Added. This is equivalent to Proc#call except it does not check the
|
||||
|
|
|
@ -36,6 +36,17 @@ completion_case_fold
|
|||
|
||||
補完時に大文字小文字を区別しない場合、TRUEを返します。
|
||||
|
||||
completion_append_character = char
|
||||
|
||||
補完時に付加される文字を文字列で指定します。先頭の一文字が
|
||||
設定され、空文字列 ("") または nil を指定すると何も付加
|
||||
されなくなります。
|
||||
|
||||
completion_append_character
|
||||
|
||||
補完時に付加される文字を文字列で返します。デフォルトは
|
||||
空白 (" ") です。
|
||||
|
||||
vi_editing_mode
|
||||
|
||||
VIモードになります。
|
||||
|
@ -50,6 +61,3 @@ HISTORY
|
|||
|
||||
ヒストリに対する操作はこの定数を通して行ってください。
|
||||
配列と同じように扱えるようになっています。
|
||||
|
||||
|
||||
|
|
@ -166,6 +166,36 @@ readline_s_emacs_editing_mode(self)
|
|||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
readline_s_set_completion_append_character(self, str)
|
||||
VALUE self, str;
|
||||
{
|
||||
if (NIL_P(str)) {
|
||||
rl_completion_append_character = '\0';
|
||||
} else {
|
||||
StringValue(str);
|
||||
|
||||
rl_completion_append_character = RSTRING(str)->ptr[0];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
readline_s_get_completion_append_character(self)
|
||||
VALUE self;
|
||||
{
|
||||
VALUE str;
|
||||
|
||||
if (rl_completion_append_character == '\0')
|
||||
return Qnil;
|
||||
|
||||
str = rb_str_new("", 1);
|
||||
RSTRING(str)->ptr[0] = rl_completion_append_character;
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
hist_to_s(self)
|
||||
VALUE self;
|
||||
|
@ -395,6 +425,10 @@ Init_readline()
|
|||
readline_s_vi_editing_mode, 0);
|
||||
rb_define_singleton_method(mReadline, "emacs_editing_mode",
|
||||
readline_s_emacs_editing_mode, 0);
|
||||
rb_define_singleton_method(mReadline, "completion_append_character=",
|
||||
readline_s_set_completion_append_character, 1);
|
||||
rb_define_singleton_method(mReadline, "completion_append_character",
|
||||
readline_s_get_completion_append_character, 0);
|
||||
|
||||
histary = rb_obj_alloc(rb_cObject);
|
||||
rb_extend_object(histary, rb_mEnumerable);
|
||||
|
|
Загрузка…
Ссылка в новой задаче