-
Notifications
You must be signed in to change notification settings - Fork 309
Allow setting popup max width #416
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
Merged
prabirshrestha
merged 7 commits into
prabirshrestha:master
from
thomasfaingnaert:popup-max-width
Jul 18, 2019
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b6a0d9d
Allow setting max width of popup window in Vim
thomasfaingnaert 02a60e7
Allow setting max width of popup window in Neovim
thomasfaingnaert d03f49a
Add documentation
thomasfaingnaert a7bb093
Uses spaces instead of tabs for indent in help
thomasfaingnaert 73e4aea
Move Neovim logic to s:setcontent
thomasfaingnaert 338d109
Rename setting to g:lsp_preview_max_width
thomasfaingnaert 6b9a4ee
Replace 'popup' with 'preview'
thomasfaingnaert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ let g:lsp_highlight_references_enabled = get(g:, 'lsp_highlight_references_enabl | |
let g:lsp_preview_float = get(g:, 'lsp_preview_float', 1) | ||
let g:lsp_preview_autoclose = get(g:, 'lsp_preview_autoclose', 1) | ||
let g:lsp_preview_doubletap = get(g:, 'lsp_preview_doubletap', [function('lsp#ui#vim#output#focuspreview')]) | ||
let g:lsp_popup_max_width = get(g:, 'lsp_popup_max_width', -1) | ||
|
||
|
||
let g:lsp_get_vim_completion_item = get(g:, 'lsp_get_vim_completion_item', [function('lsp#omni#default_get_vim_completion_item')]) | ||
let g:lsp_get_supported_capabilities = get(g:, 'lsp_get_supported_capabilities', [function('lsp#default_get_supported_capabilities')]) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you just give the maxwidth in line 233
call s:adjust_float_placement(l:bufferlines, l:maxwidth)
and enable soft wrap?Imo turning it modifiable, format and unmodifiable again feels kind of hackish.
If the current solution has any benefit, it should be done in s:setcontent, as it effects the content itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jerdna-regeiz
If you mean something like this:
then that doesn't work: it only displays the first line of the popup. Moving it to
s:setcontent
would indeed be better.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, then it depends on the source or some other settings, as it wraps each row nicely for me.
But in setcontent it looks great and a lot less hacky =)
Actually this does now apply to normal preview as well (which is nice in my opinion!). Maybe we should just call the option
g:lsp_preview_max_width
as it now applies to every flavor of it.