Please complete these steps and check these boxes (by putting an x
inside
the brackets) _before_ filing your issue:
vim --version
.:YcmDebugInfo
.:YcmToggleLogs stderr
.Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.
Perhaps I'm missing the purpose of the preview window popping up on top ever time I get a completion option, but it seems to just show what already shows up in the completion dropdown. It's kind of annoying and makes me lose focus of the line I'm working on when it shifts down constantly. Is there a way to disable it completely? I've seen options for autoclosing it after completion, but I don't want it at all.
[If filing a bug report, please include a list of steps that describe how to
reproduce the bug you are experiencing. Also include test code if relevant.]
if you don't like the preview window popping up then:
set completeopt-=preview
g:ycm_add_preview_to_completeopt
Perhaps I'm missing the purpose of the preview window popping up on top ever time I get a completion option, but it seems to just show what already shows up in the completion dropdown.
If the semantic engine for the language you're working can extract the documentation it will display it there. If you get only what you're already getting in the popup menu then it means that either you don't have documentation for the function you're completing or the semantic engine couldn't pick it up.
In any case the preview window on completion is a built in feature of vim and you can turn it off by
set completeopt-=preview
We add the relevant option only if you have let g:ycm_add_preview_to_completeopt = 1
in your configuration.
Hah. Issue ninja!
@Valloric @vheon I am using tern. Is there a way to hide the preview window if there are no doc for the item. Eg. Sometimes my custom function is highlighted in the completion menue, and it opens up the preview window empty. How can i make it not show if its empty.
I don't think there is a "native" way of doing it (so no option for that), but with some VimL I think is doable:
autocmd WinEnter * if &previewwindow && line2byte( line( '$' ) + 1 ) <=2 | :pclose | endif
I didn't test it, just wrote it :)
For anyone else who ends up here, this option is amazing, and might be what you want: https://github.com/Valloric/YouCompleteMe#the-gycm_autoclose_preview_window_after_insertion-option
The autoclose_preview_window
option is handy but it resizes the panes every time it does this. Is there a way to prevent this behaviour?
Is there any way to fix the height?
These days, if you aren't a fan of the preview window (i'm not), i would recommend using the preview popup
set previewpopup=height:10,width:60,highlight:PMenuSbar
set completeopt+=popup
set completepopup=height:15,width:60,border:off,highlight:PMenuSbar
Otherwise, all the help you need is in :help preview-window
Most helpful comment
if you don't like the preview window popping up then:
set completeopt-=preview
g:ycm_add_preview_to_completeopt