[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
Родитель 03e9887d2e
Коммит f7d9dd2e4c
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -374,7 +374,8 @@ module IRB
contents = [message] + doc.accept(formatter).split("\n") contents = [message] + doc.accept(formatter).split("\n")
x = cursor_pos_to_render.x + autocomplete_dialog.width 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 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') DialogRenderInfo.new(pos: Reline::CursorPos.new(x, y), contents: contents, width: width, bg_color: '49')
} }