Project

General

Profile

Actions

Bug #6262

closed

[readline] reverse-i-search with multibyte chars

Added by no6v (Nobuhiro IMAI) over 12 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.0.0dev (2012-04-05 trunk 35241) [x86_64-linux]
Backport:
[ruby-dev:45493]

Description

=begin
以下のように、C-r にマルチバイト文字を渡すとバイトの切れ端が返ってきます。
IM を介すので、うまく動いてもインクリメンタルサーチにはならないのですが、
履歴が検索できるようになるとありがたいです。

encoding: UTF-8

require "readline"

RUBY_DESCRIPTION # => "ruby 2.0.0dev (2012-04-05 trunk 35241) [x86_64-linux]"
Readline::VERSION # => "6.2"
IO.pipe do |r, w|
Readline.input = r
(w << "\crあ").reopen(IO::NULL)
Readline.readline # => "\x81\x82"
end

ちなみに、Emacs のバッファ上で xmpfilter を実行すると、

>> (reverse-i-search)`': \201^H\201\202

という raw-text になって、\343 はどっかに行ってしまって、
よく分からないことになっています。参考まで。
=end


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #6601: [readline] Alt-* commands do not work in reverse-i-searchClosedkouji (Kouji Takao)06/17/2012Actions

Updated by mame (Yusuke Endoh) over 12 years ago

  • Status changed from Open to Assigned
  • Assignee set to kouji (Kouji Takao)

Updated by no6v (Nobuhiro IMAI) over 12 years ago

=begin
r36123 でこちらの挙動も直っているように思います。

encoding: UTF-8

require "readline"

RUBY_DESCRIPTION # => "ruby 2.0.0dev (2012-06-18 trunk 36125) [x86_64-linux]"
Readline::VERSION # => "6.2"
Readline::HISTORY << "あん"
Readline::HISTORY << "いん"
Readline::HISTORY << "うん"
IO.pipe do |r, w|
Readline.input = r
w << "\crん\n\n"
w << "\crあん"
w.reopen(IO::NULL)
2.times do
Readline.readline("", true) # => "うん", "あん"
end
end

問題なさそうなら、クローズしておいていただけるでしょうか。
=end

Actions #3

Updated by naruse (Yui NARUSE) over 12 years ago

  • Status changed from Assigned to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0