[ruby/reline] Clear dialog when just_move_cursor is called with dialog at last line
https://github.com/ruby/reline/commit/05024b968e
This commit is contained in:
parent
930ebdd7ca
commit
9e79ae539b
@ -470,8 +470,12 @@ class Reline::LineEditor
|
|||||||
@add_newline_to_end_of_buffer = false
|
@add_newline_to_end_of_buffer = false
|
||||||
else
|
else
|
||||||
if @just_cursor_moving and not @rerender_all
|
if @just_cursor_moving and not @rerender_all
|
||||||
|
@dialogs.each do |dialog|
|
||||||
|
clear_each_dialog(dialog)
|
||||||
|
dialog.contents = nil
|
||||||
|
dialog.trap_key = nil
|
||||||
|
end
|
||||||
rendered = just_move_cursor
|
rendered = just_move_cursor
|
||||||
render_dialog((prompt_width + @cursor) % @screen_size.last)
|
|
||||||
@just_cursor_moving = false
|
@just_cursor_moving = false
|
||||||
return
|
return
|
||||||
elsif @previous_line_index or new_highest_in_this != @highest_in_this
|
elsif @previous_line_index or new_highest_in_this != @highest_in_this
|
||||||
|
@ -1254,6 +1254,23 @@ begin
|
|||||||
EOC
|
EOC
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_clear_dialog_when_just_move_cursor_at_last_line
|
||||||
|
start_terminal(10, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --autocomplete}, startup_message: 'Multiline REPL.')
|
||||||
|
write("class A\n 3\nend\n")
|
||||||
|
write("\C-p\C-p\C-p\C-e\C-hS")
|
||||||
|
write("\C-n")
|
||||||
|
write("1")
|
||||||
|
close
|
||||||
|
assert_screen(<<~'EOC')
|
||||||
|
prompt> 3
|
||||||
|
prompt> end
|
||||||
|
=> 3
|
||||||
|
prompt> class S
|
||||||
|
prompt> 31
|
||||||
|
prompt> 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…
x
Reference in New Issue
Block a user