1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

New indent must be non-negative number

This commit is contained in:
Nobuyoshi Nakada 2019-07-01 20:45:53 +09:00 committed by aycabta
parent babaad1065
commit 90c51ca391

View file

@ -796,7 +796,7 @@ class Reline::LineEditor
new_lines = whole_lines
end
new_indent = @auto_indent_proc.(new_lines, @line_index, @byte_pointer, @check_new_auto_indent)
if new_indent
if new_indent&.>= 0
md = new_lines[@line_index].match(/\A */)
prev_indent = md[0].count(' ')
if @check_new_auto_indent