diff --git a/bin/vim-erlang-tags.erl b/bin/vim-erlang-tags.erl index 5c55d12..be791f9 100755 --- a/bin/vim-erlang-tags.erl +++ b/bin/vim-erlang-tags.erl @@ -317,14 +317,14 @@ add_func_tags(Tags, File, ModName, FuncName) -> % File contains a macro or record called Name; add this information to Tags. add_record_or_macro_tag(Tags, File, Attribute, Name) -> - Kind = + {Kind, Prefix} = case Attribute of <<"record">> -> log("Record found: ~s~n", [Name]), - $r; + {$r, $#}; <<"define">> -> log("Macro found: ~s~n", [Name]), - $d + {$d, $?} end, Scope = @@ -337,9 +337,17 @@ add_record_or_macro_tag(Tags, File, Attribute, Name) -> % myrec ./mymod.erl /^-record\.\*\/;" r file: % myrec ./myhrl.hrl /^-record\.\*\/;" r - % myrec ./mymod.erl /^-define\.\*\/;" m file: - % myrec ./myhrl.hrl /^-define\.\*\/;" m + % mymac ./mymod.erl /^-define\.\*\/;" m file: + % mymac ./myhrl.hrl /^-define\.\*\/;" m add_tag(Tags, Name, File, + ["/^-\\s\\*", Attribute, "\\s\\*(\\s\\*", Name, "\\>/"], + Scope, Kind), + + % #myrec ./mymod.erl /^-record\.\*\/;" r file: + % #myrec ./myhrl.hrl /^-record\.\*\/;" r + % ?mymac ./mymod.erl /^-define\.\*\/;" m file: + % ?mymac ./myhrl.hrl /^-define\.\*\/;" m + add_tag(Tags, [Prefix|Name], File, ["/^-\\s\\*", Attribute, "\\s\\*(\\s\\*", Name, "\\>/"], Scope, Kind). diff --git a/plugin/vim-erlang-tags.vim b/plugin/vim-erlang-tags.vim index 471bd97..d364974 100644 --- a/plugin/vim-erlang-tags.vim +++ b/plugin/vim-erlang-tags.vim @@ -43,7 +43,10 @@ command! ErlangTags call VimErlangTags() function! VimErlangTagsSelect() let orig_isk = &isk set isk+=: - normal "_vaw + normal "_vawo + if getline('.')[col('.') - 2] =~# '[#?]' + normal h + endif let &isk = orig_isk endfunction