diff options
author | tomoya ishida <tomoyapenguin@gmail.com> | 2023-07-06 01:33:42 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-07-05 16:33:46 +0000 |
commit | cd7166cc8fff8d7316634a665975d4f4e21dde61 (patch) | |
tree | 3a13cff38b5dc971915385116f17f6ff55609f23 /lib/reline | |
parent | 6a871baa3cd759c0eba361b4937eeca531513a09 (diff) | |
download | ruby-cd7166cc8fff8d7316634a665975d4f4e21dde61.tar.gz |
[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
Diffstat (limited to 'lib/reline')
-rw-r--r-- | lib/reline/line_editor.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |