Skip to content

Commit

Permalink
Render properly if both autocomplete and show doc dialogs are left of…
Browse files Browse the repository at this point in the history
… the cursor
  • Loading branch information
aycabta committed Aug 31, 2021
1 parent 9684227 commit 0090203
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/irb/input-method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ def auto_indent(&block)
contents = 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')
}
Expand Down

0 comments on commit 0090203

Please sign in to comment.