Skip to content

Commit 61cc580

Browse files
committed
accept new_indent > cursor_max
1 parent 9bc3353 commit 61cc580

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/reline/line_editor.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,17 +1717,18 @@ def call_completion_proc_with_checking_args(pre, target, post)
17171717
new_lines = whole_lines
17181718
end
17191719
new_indent = @auto_indent_proc.(new_lines, @line_index, @byte_pointer, @check_new_auto_indent)
1720-
new_indent = @cursor_max if new_indent&.> @cursor_max
17211720
if new_indent&.>= 0
17221721
md = new_lines[@line_index].match(/\A */)
17231722
prev_indent = md[0].count(' ')
17241723
if @check_new_auto_indent
1725-
@buffer_of_lines[@line_index] = ' ' * new_indent + @buffer_of_lines[@line_index].lstrip
1724+
line = @buffer_of_lines[@line_index] = ' ' * new_indent + @buffer_of_lines[@line_index].lstrip
17261725
@cursor = new_indent
1726+
@cursor_max = calculate_width(line)
17271727
@byte_pointer = new_indent
17281728
else
17291729
@line = ' ' * new_indent + @line.lstrip
17301730
@cursor += new_indent - prev_indent
1731+
@cursor_max = calculate_width(@line)
17311732
@byte_pointer += new_indent - prev_indent
17321733
end
17331734
end

0 commit comments

Comments
 (0)