Project

General

Profile

Bug #6456

[readline] Readline.point when history edited

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

Status:
Third Party's Issue
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.0.0dev (2012-05-19 trunk 35705) [x86_64-linux]
Backport:
[ruby-dev:45655]

Description

=begin
以下のように、履歴をたどって編集した時に Readline.point の値がおかしくなるようです。

require "readline"

RUBY_DESCRIPTION # => "ruby 2.0.0dev (2012-05-19 trunk 35705) [x86_64-linux]"
Readline::VERSION # => "6.2"

IO.pipe do |r, w|
Readline.input = r
w << "123\n\cP456\n\cP\n"
Readline.readline("", true) # => "123"
Readline.point # => 3
Readline.readline("", true) # => "123456"
Readline.point # => 3
Readline.readline("", true) # => "123456"
Readline.point # => 6
end
# >> 123
# >> 123456
# >> 123456
=end

Also available in: Atom PDF