From cd7166cc8fff8d7316634a665975d4f4e21dde61 Mon Sep 17 00:00:00 2001 From: tomoya ishida Date: Thu, 6 Jul 2023 01:33:42 +0900 Subject: [ruby/reline] Fix wrong byte_pointer passed to auto_indent_proc (https://github.com/ruby/reline/pull/562) https://github.com/ruby/reline/commit/4348354604 --- lib/reline/line_editor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/reline/line_editor.rb') diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index 36375eee81..404a595f9c 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -1645,7 +1645,7 @@ class Reline::LineEditor @line = ' ' * new_indent + @line.lstrip new_indent = nil - result = @auto_indent_proc.(new_lines[0..-2], @line_index - 1, (new_lines[-2].size + 1), false) + result = @auto_indent_proc.(new_lines[0..-2], @line_index - 1, (new_lines[@line_index - 1].bytesize + 1), false) if result new_indent = result end -- cgit v1.2.3