-
Notifications
You must be signed in to change notification settings - Fork 46
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
support files with tabs in them #171
support files with tabs in them #171
Conversation
This was initially reported relative to TABs in go completion, but it seems that it's mandated by the ycmd protocol and we've just managed to not run into it yet.
because you can't always get what you want current-column gives the “visual” column, we want the stringual
There's a related change in 74cc5f3 on the column-in-bytes branch, though focused on ycmd itself rather than company. Can you look and see if these can be combined? I used |
so ycmd uses bytual, not stringual position
Using your column function I can still complete with the tabby file, so that seems right :) And using bytes does seem like the right thing for the protocol to do (rather than hoping clients are able to get decoded string length correctly). However, I don't think it's working 100 % yet. The error I got with the old version, when typing
was stuff like
This went away when using (- (point) (line-beginning-position)). However, I still can't do e.g.
– this gives
with ycmd-server showing
|
This is maybe a bit outside the common use-case, but I got curious so I tried
and saw "vector" as the first suggestion, but then with
I got no suggestions. With
I get "end" as the first suggestion. I get the same (Does this stuff work in vim?) |
I'm seeing the same behavior you describe. I'm fairly puzzled at this point! @Valloric We're trying to get to the bottom of how to report column offsets to However, as @unhammer describes, if I try to get completions for e.g.:
I send a request like this (I removed the noise escape sequences):
and get a response like (emacs s-exp notation):
The HTTP request to ycmd appears to have the correct offsets, etc.. Does this all work correctly in vim? If so then I'll assume that we've got a problem in the emacs client, and any thoughts you've got on what might be going on would be greatly appreciated. |
OK, rubber duck moment: Is the problem with the unicode escaping? |
@abingham I'll have to take a closer look at this, but I wouldn't be surprised if this were a bug in ycmd. Unicode support continues to be a big thorn in ycmd's side; it's just whack-a-mole with multi-byte char problems. Could you try to repro this with YCM if you have the time? If you can repro, then please open an issue on ycmd's repo. |
This change looks good to me, so I'll go ahead and merge it. @Valloric I'll see if I can replicate this with ycm. I should have some free time this afternoon. |
support files with tabs in them
@Valloric I built vim and tried installing YouCompleteMe, but I couldn't get ycm to work. The configuration phase of the build seems to be picking up different versions of the python executable and libraries, and I get this when I run
In my experience, this is often the result of python version mismatches. Anyhow, I don't have much time that I can devote to this, so I'm going to drop it for now. If you've got a working vim/ycm installation, though, it shouldn't take more than a few minutes to see if completion on one of the misbehaving examples above works for you. |
I've created a new issue in ycmd for this. |
because you can't always get what you want
current-column gives the “visual” column, we want the stringual