diff options
author | aycabta <aycabta@gmail.com> | 2020-12-24 21:44:09 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2020-12-24 23:26:22 +0900 |
commit | 78421319d0401c37497f2b5df7110e92eef9f0e4 (patch) | |
tree | f30077d4490bc175318544d2a594d17dc95677bc /lib | |
parent | 0db9842b2ca85709424d6c9c1e11caeae30dfae7 (diff) |
[ruby/reline] Use #bytesize for vi_replace_char
This closes ruby/reline#228.
https://github.com/ruby/reline/commit/8205fa0b00
Diffstat (limited to 'lib')
-rw-r--r-- | lib/reline/line_editor.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index 4f32f26b63..c1564fa57e 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -2478,7 +2478,7 @@ class Reline::LineEditor byte_size = Reline::Unicode.get_next_mbchar_size(@line, @byte_pointer) before = @line.byteslice(0, @byte_pointer) remaining_point = @byte_pointer + byte_size - after = @line.byteslice(remaining_point, @line.size - remaining_point) + after = @line.byteslice(remaining_point, @line.bytesize - remaining_point) @line = before + k.chr + after @cursor_max = calculate_width(@line) @waiting_proc = nil @@ -2489,7 +2489,7 @@ class Reline::LineEditor end before = @line.byteslice(0, @byte_pointer) remaining_point = @byte_pointer + byte_size - after = @line.byteslice(remaining_point, @line.size - remaining_point) + after = @line.byteslice(remaining_point, @line.bytesize - remaining_point) replaced = k.chr * arg @line = before + replaced + after @byte_pointer += replaced.bytesize |