Closed JacobLeach closed 1 year ago
Thanks for the detailed report.
Yeah I can see that would be annoying. We should strip tabs out of the diagnostics.
Fancy making a PR ? :)
BTW as a workaround, you could use virtual text for diagnostics display: https://github.com/ycm-core/YouCompleteMe#the-gycm_echo_current_diagnostic-option
Issue Prelude
Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:
vim --version
.:YcmDebugInfo
.:YcmToggleLogs
command.vim -Nu /path/to/YCM/vimrc_ycm_minimal
, including what I expected to happen and what actually happened.install.py
(orcmake
/make
/ninja
) including its invocationThank you for adhering to this process! It ensures your issue is resolved quickly and that neither your nor our time is needlessly wasted.
Issue Details
The diagnostic line echos do not seem to handle tab characters which Go uses in error messages. When ycm truncates the message: https://github.com/ycm-core/YouCompleteMe/blob/4f1dcf4f971517b5a41d420b3671259f917e3827/python/ycm/vimsupport.py#L750-L764
the message is less than the vim width but it appears vim's echo command is turning the tabs into multiple spaces which causes the message length to exceed the vim width and that causes the "Press ENTER or type command to continue" message.
I added
message = message.replace( '\t', ' ' )
right after https://github.com/ycm-core/YouCompleteMe/blob/4f1dcf4f971517b5a41d420b3671259f917e3827/python/ycm/vimsupport.py#L753C5-L753C43 and it resolved the issue but I've not been able to find any reliable information on how vim handles tab characters in echos so I'm unsure if there is a better method of handling this.vim -Nu YouCompleteMe/vimrc_ycm_minimal main.go
veryLongFunction()
line in themain()
functionDiagnostic display that properly truncates to avoid "Press ENTER or type command to continue"
Diagnostic data
Output of
vim --version
Output of
YcmDebugInfo
Output of
YcmDiags
Output of
git rev-parse HEAD
in YouCompleteMe installation directoryContents of YCM, ycmd and completion engine logfiles
https://gist.github.com/JacobLeach/fd124aa062c0c1951c109ddf441ea29e
OS version, distribution, etc.
I reproduced for this issue in an interactive ubuntu container:
Output of build/install commands
N/A