Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion autoload/omni/cpp/items.vim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
" Description: Omni completion script for cpp files
" Maintainer: Vissale NEANG
" Last Change: 26 sept. 2007
" Last Change: 26 feb. 2026

" Build the item list of an instruction
" An item is an instruction between a -> or . or ->* or .*
Expand Down Expand Up @@ -297,6 +297,12 @@ function! s:GetTypeInfoOfVariable(contextStack, szVariable, bSearchDecl)
return result
endif

" In the case of 'struct ... {} static variable;' the 'typeref' contains a trailing space.
" Tested with Universal Ctags 6.2.1
if has_key(tagItem, 'typeref')
let tagItem.typeref = substitute(tagItem.typeref, '\s\+$', '', '')
endif

let szCmdWithoutVariable = substitute(omni#cpp#utils#ExtractCmdFromTagItem(tagItem), '\C\<'.a:szVariable.'\>.*', '', 'g')
let tokens = omni#cpp#tokenizer#Tokenize(omni#cpp#utils#GetCodeFromLine(szCmdWithoutVariable))
let result = omni#cpp#utils#CreateTypeInfo(omni#cpp#utils#ExtractTypeInfoFromTokens(tokens))
Expand Down
8 changes: 6 additions & 2 deletions doc/omnicppcomplete.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
*omnicppcomplete*

Author: Vissale NEANG (fromtonrouge AT gmail DOT com)
Last Change: 26 sept. 2007
Last Change: 26 feb. 2026

OmniCppComplete version 0.41
OmniCppComplete version 0.42

For Vim version 7.0 and above

Expand Down Expand Up @@ -883,6 +883,10 @@ templates. That's why the script does not handle templates.
==============================================================================
8. History~
*omnicpp-history*
Version 0.42
- Fixed an issue with static variable detection when using Universal
Ctags (6.2.1).

Version O.41
- It's recommended to update ctags to version 5.7 or higher
- The plugin is now activated for C files
Expand Down