Skip to content

Commit

Permalink
Clear dialog in pasting
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Dec 16, 2021
1 parent 7b50638 commit dabf531
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/reline/line_editor.rb
Expand Up @@ -651,6 +651,7 @@ def add_dialog_proc(name, p, context = nil)

private def render_each_dialog(dialog, cursor_column)
if @in_pasting
clear_each_dialog(dialog)
dialog.contents = nil
dialog.trap_key = nil
return
Expand Down
11 changes: 11 additions & 0 deletions test/reline/yamatanooroti/test_rendering.rb
Expand Up @@ -1217,6 +1217,17 @@ def test_scroll_at_bottom_for_dialog
EOC
end

def test_clear_dialog_in_pasting
start_terminal(10, 40, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --autocomplete}, startup_message: 'Multiline REPL.')
write("S")
write("tring ")
close
assert_screen(<<~'EOC')
Multiline REPL.
prompt> String
EOC
end

def write_inputrc(content)
File.open(@inputrc_file, 'w') do |f|
f.write content
Expand Down

0 comments on commit dabf531

Please sign in to comment.