mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
22cc2243f9
commit
b0db420b0e
2 changed files with 14 additions and 1 deletions
|
@ -260,7 +260,7 @@ class Reline::LineEditor
|
||||||
end
|
end
|
||||||
|
|
||||||
def reset_variables(prompt = '', encoding:)
|
def reset_variables(prompt = '', encoding:)
|
||||||
@prompt = prompt
|
@prompt = prompt.gsub("\n", "\\n")
|
||||||
@mark_pointer = nil
|
@mark_pointer = nil
|
||||||
@encoding = encoding
|
@encoding = encoding
|
||||||
@is_multiline = false
|
@is_multiline = false
|
||||||
|
|
|
@ -1228,6 +1228,19 @@ begin
|
||||||
EOC
|
EOC
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_prompt_with_newline
|
||||||
|
ENV['RELINE_TEST_PROMPT'] = "::\n> "
|
||||||
|
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
|
||||||
|
write("def hoge\n 3\nend")
|
||||||
|
close
|
||||||
|
assert_screen(<<~'EOC')
|
||||||
|
Multiline REPL.
|
||||||
|
::\n> def hoge
|
||||||
|
::\n> 3
|
||||||
|
::\n> end
|
||||||
|
EOC
|
||||||
|
end
|
||||||
|
|
||||||
def write_inputrc(content)
|
def write_inputrc(content)
|
||||||
File.open(@inputrc_file, 'w') do |f|
|
File.open(@inputrc_file, 'w') do |f|
|
||||||
f.write content
|
f.write content
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue