diff options
author | aycabta <aycabta@gmail.com> | 2021-08-24 16:15:04 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2021-08-29 20:30:33 +0900 |
commit | fb9fe4c43fe37fb9c78090114d373b1eaf195fc9 (patch) | |
tree | 83d399ff4c8799cdb84b0bd55bc1be03763ef5e4 /lib/reline.rb | |
parent | 9b2afb2eed894aa45f7bf2a1ef7793290fe95e9e (diff) |
[ruby/reline] Display autocomplete below original line if end point was wrapped
https://github.com/ruby/reline/commit/49f3392d59
Diffstat (limited to 'lib/reline.rb')
-rw-r--r-- | lib/reline.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/reline.rb b/lib/reline.rb index fade2da9d6..72621fe190 100644 --- a/lib/reline.rb +++ b/lib/reline.rb @@ -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) |