Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow lsp-ui-doc-max-width to be nil for frame-width #487

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lsp-ui-doc.el
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ This only takes effect when `lsp-ui-doc-position' is 'top or 'bottom."
:group 'lsp-ui-doc)

(defcustom lsp-ui-doc-max-width 150
"Maximum number of columns of the frame."
"Maximum number of columns of the frame or nil for `frame-width'."
:type 'integer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should specify a type to nil too.

:group 'lsp-ui-doc)

Expand Down Expand Up @@ -411,6 +411,7 @@ We don't extract the string that `lps-line' is already displaying."
'lsp-ui-doc--webkit-resize-callback)

(let* ((frame-width (frame-width))
(lsp-ui-doc-max-width (or lsp-ui-doc-max-width frame-width))
(fill-column (min lsp-ui-doc-max-width (- frame-width 5))))
(when (> (lsp-ui-doc--buffer-width) (min lsp-ui-doc-max-width frame-width))
(lsp-ui-doc--with-buffer
Expand Down