justmao945 / vim-clang

Clang completion plugin for vim
ISC License
357 stars 47 forks source link

g:clang_auto doesn't stop autocompletion after loading the plugin #107

Open crr0004 opened 7 years ago

crr0004 commented 7 years ago

When setting the option g:clang_auto to 0 you have to set it before the plugin is loaded otherwise it won't have an effect, and will auto complete no matter what.

This is because the plugin uses mappings I.E

if g:clang_auto   " Auto completion
    inoremap <expr> <buffer> . <SID>CompleteDot()
    inoremap <expr> <buffer> > <SID>CompleteArrow()
    if &filetype == 'cpp'
      inoremap <expr> <buffer> : <SID>CompleteColon()
    endif
  endif
justmao945 commented 7 years ago

Yes, you must set it in the .vimrc, but not during running vim ....

crr0004 commented 7 years ago

This fixes that issue. You can set while running VIM and after loading your plugins.

smekkley commented 3 years ago

@justmao945 Any chance merging this pull request?