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

[lsp-ui-doc] Wrap lines when not using childframes #183

Merged
merged 2 commits into from
Sep 30, 2018

Conversation

nanzhong
Copy link
Contributor

@nanzhong nanzhong commented Sep 30, 2018

When not using childframes, lsp-ui-doc contents should be wrapped according to lsp-ui-doc-max-width.

Currently very long lines will result in a overlay that spans the entire width of the window that has truncated lines, eg.
afa52952-8bd0-48f8-9857-016dce435b5e
This is not helpful as the content is truncated and it also results in an inconsistent look.

Instead I think the overlay should be limited in width according to lsp-ui-doc-max-wdith resulting in the following:
d55c75a3-eaf2-4a00-a465-236229152c72

I’m quite new to elisp, so please let me know how I can improve my changes if needed. Thanks!

When not using childframes, lsp-ui-doc contents should be wrapped
according to lsp-ui-doc-max-width.
lsp-ui-doc.el Outdated
(if (lsp-ui-doc--inline-p)
(progn (let ((fill-column lsp-ui-doc-max-width))
(fill-region (point-min) (point-max)))
(buffer-substring (point-min) (point-max))))
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need (buffer-substring (point-min) (point-max))? The return value is not used.

I think you may use: when + fill-region

@nanzhong
Copy link
Contributor Author

@MaskRay good question. This was me pulling something from elsewhere for line wrapping strings. I’ve updated with your your suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants