Closed DasOhmoff closed 7 years ago
Thanks for the report, but could you list the exact steps you take to reproduce this, including an example file? Could you also let us know the output of the following commands within Vim:
:set autowrite?
:set autowriteall?
I had a theory that it would be because the buffer had no name (e.g. after :enew
and auto write was trying to save the file), though I cannot reproduce, so you'll need to list the exact steps we can follow to reproduce. Thanks.
Hi, thanks for your answer.
I was trying to reproduce the error step by step, so I emptied my vimrc first.
The error was gone. After some time deleting my vimrc commands and testing I found the command that creates the error: au BufWinEnter ?* silent loadview 1
.
I copied those commands from the web to recover my folded code when I reopen the files:
au BufWinLeave ? mkview 1 au BufWinEnter ? silent loadview 1
So without the second line there is no error. I am really not a experienced vim user, so ist there a way to reopen files with their folds without getting this ycm error?
And another question, is there a way to use FixIt without the quickfix window popping up?
Thank you very much.
ist there a way to reopen files with their folds without getting this ycm error?
You can suppress the errors with silent!
:
au BufWinLeave ?* silent! mkview 1
au BufWinEnter ?* silent! loadview 1
And another question, is there a way to use FixIt without the quickfix window popping up?
Yes, by calling cclose
on the YcmQuickFixOpened
autocommand:
autocmd User YcmQuickFixOpened cclose
Hi, thanks for your answer.
You can suppress the errors with silent!
That would work, but it would not really "fix" the errors, which is why I think there might be a better solution.
autocmd User YcmQuickFixOpened cclose
Nice! That really works well.
Thanks a lot.
That would work, but it would not really "fix" the errors, which is why I think there might be a better solution.
You could try:
au BufWinLeave ?* if !empty(bufname('%')) | mkview 1 | endif
au BufWinEnter ?* if !empty(bufname('%')) | silent loadview 1 | end
This checks if the current buffer has a name before running the mkview
and loadview
commands. I would still recommend to suppress these errors as they may happen in other situations and are rather harmless.
Anyway, closing as not a YCM issue.
Hi.
When I try to open the YcmDiags window, for example when I have this error
int x = 0
(no semicolon at the end). I get an error message:After I press enter to accept the message it actually openes the YcmDiags window with the correct error message in it.
Another thing is when I try to use the FixIt feature of YouCompleteMe, it prints some errors too. For example when I miss a semicolon again (
int x = 0
), I get this messageexpected ';' at end of declaration (FixIt)
, so I try to use the:FixIt
feature and this Error gets printed:After I press enter the error get fixed, so in this case it puts a semicolon at the end. Also a window showing the fixes pops up. How do I fix those errors?
vim --version:
Output of
YcmDebugInfo
Installation output:
By the way it doesn't matter if I install YCM with python3 or not, same result.
I really appreciate your help, thank you.