-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Flashing in header files #669
Comments
Try to make a small, minimal test case & test procedure that reproduces the issue. Until then, I'm assuming this is related to your configuration (seems most likely) and not a YCM bug. BTW remove the paths to compiler binaries in your flags. |
I have narrowed this down further. It actually doesn't seem to have anything to do with .h/.cpp files. Two conditions are needed: I've produced this in both the version of Vim in the the Debian Testing repositories and a recent version compiled from source. To reproduce: Or, just: mkdir ~/dev; cd ~/dev
git clone http://github.com/indianajohn/ycm-bug/
cd ycm-bug
./install.sh (wait) gvim hello-world.cpp & (insert some text without saving) :o goodbye-cruel-world.cpp (enter insert mode and start typing). |
|
|
I have same flickering problem with same version of vim. Firstly I thought it is due to problem in my vimrc but now it seems a YCM bug. It is confirmed if you are editing two unsaved buffer window will flicker. And if i disable YCM, no flicker. |
Same problem here. My current workaround for when I see flicker is
On Lubuntu 13.10. |
This might need to be investigated further. |
I think the flickering I'm seeing is related to this, except it's not that consistent, using vim from the hg repository and latest YCM and Syntastic. |
I can confirm this issue. I think it might be a Syntastic bug, but I'll have to explore further. |
@Valloric since syntastic won't fix the bug, can we at least get a version check before setting the lazy redraw? |
@meh That's what I've been thinking of, but I'm not sure which version of Vim has the bugfix that the lazy redraw fixes. |
@Valloric how about a compatibility flag to disable the workarounds for old versions? |
@meh Actually what I'll do is just remove the use of the lazy redraw entirely. I'd rather have the super-rare Vim crash in old versions of Vim than have the incredibly annoying flashing which occurs much more often. So the workaround for #593 is going to be reverted. @oblitum Do you know which version of Vim has your bugfix? I'd like to mention it in the FAQ. |
I just updated YCM but I have to say that for me the bug is still there. As long as any other buffer is open and unsaved, any edit to the file causes the screen to flicker. I have to say that it does not happen if I simply move the cursor (be it in normal mode or insert mode). It flickers once always when exiting insert mode for normal mode (but not when I enter insert mode from normal mode). And happens every time I add or remove a character in insert mode. Visual mode seems to be unaffected. It flickers even if syntastic is toggled off. |
@Svalorzen It appears you are correct. Reopening. |
I finally tracked this down and worked around the Vim bug. Here's what I wrote in the commit message:
@oblitum You know the Vim codebase pretty good, could you take a look at the root cause of this? I've worked around the problem so it's not a pressing issue, but executing |
@Valloric sorry, I entirely missed the discussion that was happening here. Answering the month older question, the version with the bugfix for #593 (patched file: popupmnu.c) is:
(Bram ended up applying a somewhat different patch which also worked) About the flickering problem, on my machine it's somewhat quite subtle so I didn't notice there was such an issue, but anyway, debugging I found the problem lies with the lines 8969 and 8971 of the option.c file. Commenting out those lines, the flickering vanishes. That calls end up doing a lot of buffer/window operations when there's a hidden edited buffer, I think unecessarily. They stand as guarding calls around the 8970 that does the useful (and what should have been simple) job of getting a buffer property. It must be fixed, when I get the time I'll debug a bit more and post an issue or patch at the mailing list. |
About this being a GVIM specific problem, it's not since I've noticed the subtle flickering on terminal (and debugged vim there). |
@oblitum Thanks for looking into this! You're a gem, dude. I'm sure Bram would love to see a patch for this. Like I said, this is not critical at all since YCM has a good workaround. I'd just like to prevent a situation where someone else hits the same bug; it took me the better part of a month to track down the root cause of this nonsense. |
I'm using YouCompleteMe together with the official Syntastic from scrooloose/syntastic. I have confirmed that this issue is present in the most recent version in Github.
I have a project set up so that all CPP files containing class declarations have a corresponding H file by the same name, but a different extension. Getting completion in the H files isn't particularly important for me,but when I don't provide the flags for that file, I get "can't find header..." errors. So I have set up YCM to provide the same flags for the header file as the CPP file.
However, now that I've provided the flags for the file, not only do I not get proper completions (I get cached completions, but if I type std::, for example, I don't get anything from STL), but I also get flickering every time I'm inserting text into the file.
I have narrowed it down to whenever VIM has a changed buffer stored for the .cpp file; if the other file is open but unaltered, no flickering occurs.
edit: I just checked the log files generated in /tmp, and nothing informative seems to be appearing. Just "initiating buffer for file blah.h", "initiating buffer for file blah.cpp" and "completion request for..." nothing else.
I've attached the contents of my .ycm_extra_conf.py file. Let me know if there's anything else I can provide to help you solve this problem.
Regards,
John
The text was updated successfully, but these errors were encountered: