Looks like a limitation in omnicppcomplete, but I stopped the vim debugger and found it.
Open autoload /omni/cpp/utils.vim, go to line 518, it should look like this:
for token in tokens if state==0 if token.value=='>' let parenGroup = token.group let state=1 elseif token.kind == 'cppWord' let szResult = token.value.szResult let state=2 elseif index(['*', '&'], token.value)<0 "This is line 518 break endif
And change this line to:
elseif token.value != 'const' && index(['*', '&'], token.value)<0
Or, here the vim command does this =):
/index(\['\*', '&'],<CR>itoken.value != 'const' &&<ESC>:w
I will try to pass this to the omnicppcomplete developer, but it's kind of hacky, dunno, if he logs in. Could check if there is token.kind == 'cppKeyword', but I decided that I 'd err on the change side the least.
source share