• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision191de01af32cf9110cc40b8655d76161ec537fb5 (tree)
l'heure2018-12-12 07:34:38
AuteurMarkus <Markus@dark...>
CommiterMarkus

Message de Log

put highlighting of tagged types and functions in a single function

Change Summary

Modification

--- a/after/ftplugin/c.vim
+++ b/after/ftplugin/c.vim
@@ -2,10 +2,9 @@
22 " Description: Some support functions and mappings for C code files.
33 " Maintainer: markus prepens (markus dot prepens at gmail dot com)
44
5-command! -buffer -nargs=0 ShowFunctions call c#HighlightTaggedFunctions()
6-command! -buffer -nargs=0 ShowTypes call c#HighlightTaggedTypes()
7-command! -buffer -nargs=0 ToggleSourceHeaderFile call c#ToggleSourceHeaderFile()
8-command! -buffer -nargs=0 PrettifyCode call c#CodeCleanup()
5+command! -buffer -nargs=0 ShowTags call c#HighlightTaggedFunctions()
6+command! -buffer -nargs=0 ToggleSourceHeaderFile call c#ToggleSourceHeaderFile()
7+command! -buffer -nargs=0 PrettifyCode call c#CodeCleanup()
98
109 nnoremap <buffer> <LocalLeader><TAB> :ToggleSourceHeaderFile<CR>
1110
--- a/autoload/c.vim
+++ b/autoload/c.vim
@@ -56,28 +56,21 @@ function! c#ToggleSourceHeaderFile()
5656 endfor
5757 endfunction
5858
59-" Description: scan trough current TAG file, find the function symbols and
60-" highlight them as keyword.
61-function! c#HighlightTaggedFunctions()
62- for l:tagsfile in tagfiles()
63- for l:line in readfile(l:tagsfile)
64- if match(l:line, '\<f\>') > 0
65- let l:symbolStr = split(l:line, '\s\+')[0]
66- execute "syntax keyword Function " . l:symbolStr
67- endif
68- endfor
69- endfor
70-endfunction
71-
72-" Description: scan trough current TAG file, find the type symbols and
73-" highlight them as keyword.
74-function! c#HighlightTaggedTypes()
59+" Description: scan trough current TAG file, find the type and function symbols
60+" and highlight them as keyword.
61+function! c#HighlightTags()
62+ let g:tagged_files = []
7563 for l:tagsfile in tagfiles()
7664 for l:line in readfile(l:tagsfile)
65+ let l:line_split = split(l:line, '\s\+');
7766 if match(l:line, '\<t\>') > 0
78- let l:typeStr = split(l:line, '\s\+')[0]
79- execute "syntax keyword cType " . l:typeStr
67+ execute "syntax keyword cType l:line_split[0]"
68+ call insert(g:tagged_files, line_split[1])
69+ elseif match(l:line, '\<f\>') > 0
70+ execute "syntax keyword Function l:line_split[0]"
71+ call insert(g:tagged_files, line_split[1])
8072 endif
8173 endfor
74+ call uniq(sort(g:tagged_files))
8275 endfor
8376 endfunction