Vim buffer navigation broken after RA writes error messages inline

I'm using MacVim version 9 and my Rust development setup consists of YouCompleteme plugin which uses rust-analyzer.

Everything is working as expected with the exception that the buffer I'm editing get's the Rust errors added inline as comments to the right side of the offending lines. When this comments are multiline the line navigation on the buffer is completely broken.

I don't even need those inline errors directly shown within the code since I prefer seeing them only when I put the cursor over the offending line as always.

Does anyone know how to avoid the error messages being added into the buffer? I've checked rust-analyzer options but I don't see any that would disable this behaviour.

Attached an screenshot of the error message automatically added and which I want to get rid of (E: match arms have incompatible types....)

I'm an ale guy myself, but I think these error comments are part of the inlay hints feature of YCM. You could try disabling inlay hints and see if the comment with the error message disappears:

" globally disable ycm inlay hints in your .vimrc
let g:ycm_enable_inlay_hints = 0
" locally disable ycm for your current buffer from the command mode
:let b:ycm_enable_inlay_hints = 0

Thanks for the response @jofas,

This setting seems not to be responsible for rendering these info since setting it to 0 does not change the behaviour.

hmm, I followed this post: plugin you complete me - How to disable YouCompleteMe's error checking? - Vi and Vim Stack Exchange to this option: GitHub - ycm-core/YouCompleteMe: A code-completion engine for Vim which seems to be the culprit behind these error comments


It was indeed 'ale' making this. I've disabled the plugin and the inline errors are not shown anymore. The problem was caused when these inline errors width is greater than the split (I usually use two splits).

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.