Closed wilywampa closed 10 years ago
On 21.10.2014 23:11, wilywampa wrote:
For some reason loading clang_complete causes Vim's terminal output to look like the attached screenshot. The completion itself actually works fine. I can temporarily fix the problem by running |:let &term = &term|. There are no display/completion problems in gVim.
I am running in Cygwin and I updated everything and reinstalled all Clang-related packages today to no avail. I have tried mintty and xterm, multiple settings of |$TERM| (xterm, xterm-256color, screen-256color, dummy), and multiple versions of vim (7.417, 7.444, 7.487) but nothing has made any difference. vim-clang works without any problems but I prefer clang_complete.
Any ideas?
untitled https://cloud.githubusercontent.com/assets/4472522/4726864/52676b12-5966-11e4-801f-7ab2cb727f04.png
Not really. Did clang_complete work before for you? Could you check if an older version of clang_complete does not have these issues? If this is the case, we could try to bisect the problematic commit.
Tobias
Fortunately I had a different computer with an older Cygwin installation on which clang_complete does work. It appears that the latest version of libclang that ships with Cygwin is causing the problem. I have no clue what kind of change would cause this kind of problem.
To work around the problem, I downloaded libclang-3.1-3.tar.bz2 from here and pointed g:clang_library_path
to it: http://mirror.mcs.anl.gov/cygwin/x86/release/llvm/libclang/
I also had to modify libclang.py because the include path for Cygwin libclang has changed from /usr/lib/clang/version
/include to /usr/lib/clang/i686-pc-cygwin/version
/include or /usr/lib/clang/x86-64-pc-cygwin/version
/include.
The newer versions of libclang (3.4.2-1 and 3.4.2-3) have the problem I described. I should probably report this on the Cygwin mailing list but I have no clue how to even properly define the problem.
On 22.10.2014 19:54, wilywampa wrote:
Fortunately I had a different computer with an older Cygwin installation on which clang_complete does work. It appears that the latest version of libclang that ships with Cygwin is causing the problem. I have no clue what kind of change would cause this kind of problem.
To work around the problem, I downloaded libclang-3.1-3.tar.bz2 from here and pointed |g:clang_library_path| to it: http://mirror.mcs.anl.gov/cygwin/x86/release/llvm/libclang/
OK.
I also had to modify libclang.py because the include path for Cygwin libclang has changed from /usr/lib/clang/|version|/include to /usr/lib/clang/i686-pc-cygwin/|version|/include or /usr/lib/clang/x86-64-pc-cygwin/|version|/include.
Could you submit a patch that adds this path?
The newer versions of libclang (3.4.2-1 and 3.4.2-3) have the problem I described. I should probably report this on the Cygwin mailing list but I have no clue how to even properly define the problem.
Sorry, no idea on my side either.
Tobias
I don't think that patch would be a good idea because the libclang installed by Cygwin does find its headers without that change, just not when I use an old DLL which had the headers somewhere else. A compiled a few versions of Clang from source and found that 3.3 works and 3.4 does not. The releases are too different to tell what change could cause this so I'm checking out the SVN repo and hopefully finding the exact revision where it broke. It's pretty slow to compile in Cygwin so this will take awhile.
Problem solved (after hours of compiling well into double digits, but solved nonetheless)!
Revision 188615 of llvm/lib/Support/Unix/Process.inc
changed the way terminal capabilities are detected, and the new logic decides that colored terminal output is not available in Cygwin. Installing the libncurses-devel
package and recompiling solves the problem (basically just following the directions here without skipping the part about colored diagnostics). I will post on the Cygwin mailing list with this information to hopefully solve the problem in a future distribution.
Still, no clue why libclang affects terminal settings when it's being used from Python bindings and not displaying anything on screen.
One additional minor issue that came up is getBuiltinHeaderPath
expects and directory, but recently it became allowed to point g:clang_library_path
to a specific file instead of just a directory. I will submit a pull request for that issue.
The pull request to fix library_path
is here: https://github.com/Rip-Rip/clang_complete/pull/424
I must have gotten confused about what version I was building and the above information is wrong. libncurses-devel
doesn't seem to make a difference. What does fix the problem is using --enable-terminfo=no
for the configure script or -DLLVM_ENABLE_TERMINFO=OFF
if you build with cmake.
For some reason loading clang_complete causes Vim's terminal output to look like the attached screenshot. The completion itself actually works fine. I can temporarily fix the problem by running
:let &term = &term
. There are no display/completion problems in gVim.I am running in Cygwin and I updated everything and reinstalled all Clang-related packages today to no avail. I have tried mintty and xterm, multiple settings of
$TERM
(xterm, xterm-256color, screen-256color, dummy), and multiple versions of vim (7.417, 7.444, 7.487) but nothing has made any difference. vim-clang works without any problems but I prefer clang_complete.Any ideas?