mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/reline] Display autocomplete below original line if end point was wrapped
49f3392d59
This commit is contained in:
parent
9b2afb2eed
commit
fb9fe4c43f
2 changed files with 9 additions and 1 deletions
|
@ -196,7 +196,11 @@ module Reline
|
|||
result = nil
|
||||
end
|
||||
end
|
||||
[Reline::CursorPos.new(cursor_pos.x - Reline::Unicode.calculate_width(target), nil), result]
|
||||
x = cursor_pos.x - Reline::Unicode.calculate_width(target)
|
||||
if x < 0
|
||||
x = screen_width + x
|
||||
end
|
||||
[Reline::CursorPos.new(x, nil), result]
|
||||
}
|
||||
inner_readline(prompt, add_hist, true, &confirm_multiline_termination)
|
||||
|
||||
|
|
|
@ -510,6 +510,10 @@ class Reline::LineEditor
|
|||
@line_editor.instance_variable_get(:@just_cursor_moving)
|
||||
end
|
||||
|
||||
def screen_width
|
||||
@line_editor.instance_variable_get(:@screen_size).last
|
||||
end
|
||||
|
||||
def call
|
||||
instance_exec(&@proc_to_exec)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue