summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-01 20:45:53 +0900
committeraycabta <aycabta@gmail.com>2019-07-01 20:46:00 +0900
commit90c51ca39170030b2ea0611bcbb435b76915a287 (patch)
tree15b477cab1fd7db108c16b49e82c092da3a3726a
parentbabaad1065b1e45614d03e30f82c9007cc115b7c (diff)
New indent must be non-negative number
-rw-r--r--lib/reline/line_editor.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index f068a3c..bc795b8 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -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