1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/irb] Render properly if both autocomplete and show doc dialogs are left of the cursor

https://github.com/ruby/irb/commit/0090203107
This commit is contained in:
aycabta 2021-08-31 20:48:05 +09:00
parent 03e9887d2e
commit f7d9dd2e4c

View file

@ -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')
}