deoplete-plugins / deoplete-clang

deoplete.nvim source for C/C++/Obj-C/Obj-C++ with clang-python3
MIT License
189 stars 73 forks source link

The completion windows pop up when it should not show. #28

Closed zhou13 closed 8 years ago

zhou13 commented 8 years ago

Problems summary

The completion windows pop up when it should not show.

Case:

#include <iostream>

using namespace std;

class Foo {
public:
    void work();
};

int main()
{
    Foo x; 
    x.work(); |
}

If you put the cursor after | and go into insert mode, a completion window will pop up. This is not expected.

My vim configuration:

" deoplete
let g:deoplete#enable_at_startup = 1
let g:deoplete#sources#clang#libclang_path = "/usr/lib/libclang.so"
let g:deoplete#sources#clang#clang_header = "/usr/lib/clang"
let g:neopairs#enable = 1
zchee commented 8 years ago

@zhou Thanks! Maybe it's problem is caused by self.input_pattern (not tested) I will check and fix later. please a moment.

zchee commented 8 years ago

@zhou Sorry, It question.

At first, I have never written a C(C++) \o/ and For example, Golang have this if idiom.

if err := foo(); err != nil {
    return err
}

Is C also have it? If so, I think that operation is normal. What about you think?

Note: If fix self.input_pattern regex, it's possible to ignore popup the window after ;.

zchee commented 8 years ago

@zhou Oh, misunderstood 😱 not show? If so, it's bug.

I do not yet test, will test later.

Edit: Hm... confusing :( Sorry, I'm not good at English... Do you want to show popup? not show ?

zhou13 commented 8 years ago

I think the completion window should NOT pop up in this situation since it is after a statement ending with ;. It should follow my setting in g:deoplete#auto_complete_start_length.

zhou13 commented 8 years ago

OK. I think this is a deoplete bug. I will make a pull request there.