summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-08-31 20:48:05 +0900
committeraycabta <aycabta@gmail.com>2021-09-04 21:55:55 +0900
commitf7d9dd2e4c1c0668c27093373dc08a3ede4a56f8 (patch)
tree797bcedf499cdfeff483076791592620cd24454b /lib
parent03e9887d2e4c637a70791c65be6e496dbe190ed1 (diff)
[ruby/irb] Render properly if both autocomplete and show doc dialogs are left of the cursor
https://github.com/ruby/irb/commit/0090203107
Diffstat (limited to 'lib')
-rw-r--r--lib/irb/input-method.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb
index ef9b9a675a..10765a2c42 100644
--- a/lib/irb/input-method.rb
+++ b/lib/irb/input-method.rb
@@ -374,7 +374,8 @@ module IRB
contents = [message] + doc.accept(formatter).split("\n")
x = cursor_pos_to_render.x + autocomplete_dialog.width
- x = cursor_pos_to_render.x - width if x + width >= screen_width
+ #x = cursor_pos_to_render.x - width if x + width >= screen_width
+ x = autocomplete_dialog.column - width if x + width >= screen_width
y = cursor_pos_to_render.y + pointer - autocomplete_dialog.scroll_top
DialogRenderInfo.new(pos: Reline::CursorPos.new(x, y), contents: contents, width: width, bg_color: '49')
}