ruby / reline

The compatible library with the API of Ruby's stdlib 'readline'

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[nil] is passed to auto_indent_proc when exit with CTRL+d

tompng opened this issue · comments

Description

require 'reline'
Reline.auto_indent_proc=->(lines,*){raise "lines was [nil]" if lines == [nil]}
Reline.readmultiline('>'){true}
>(press CTRL+d)
sample.rb:2:in `block in <main>': lines was [nil] (RuntimeError)

I expect lines passed to auto_indent_proc to be an array of string.

IRB should specially handle [nil] to not raise error on exit
ruby/irb#515 (comment)

Terminal Emulator

macOS Terminal.app