summaryrefslogtreecommitdiffstats
path: root/runtime/syntax
diff options
context:
space:
mode:
authorLuca Saccarola <github.e41mv@aleeas.com>2023-12-24 18:57:02 +0100
committerChristian Brabandt <cb@256bit.org>2024-01-23 21:34:09 +0100
commitca0e9823a1dfd71a17c0f08cb7973d413bf98999 (patch)
tree93180b5d3b740282ba8b563f4efca6959afafd1e /runtime/syntax
parentf96dc8d07f752ddd96d1447d85278a85255a1462 (diff)
runtime(c): Highlight user defined functions
closes: #13763 Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime/syntax')
-rw-r--r--runtime/syntax/c.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/runtime/syntax/c.vim b/runtime/syntax/c.vim
index 5ed8fdc847..a593bd26c2 100644
--- a/runtime/syntax/c.vim
+++ b/runtime/syntax/c.vim
@@ -444,6 +444,14 @@ syn match cUserLabel display "\I\i*" contained
syn match cBitField display "^\s*\zs\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
syn match cBitField display ";\s*\zs\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
+if exists("c_functions")
+ syn match cFunction "\<\h\w*\ze\_s*("
+ endif
+
+if exists("c_function_pointers")
+ syn match cFunctionPointer "\%((\s*\*\s*\)\@<=\h\w*\ze\s*)\_s*(.*)"
+endif
+
if exists("c_minlines")
let b:c_minlines = c_minlines
else
@@ -513,6 +521,8 @@ hi def link cCppOutSkip cCppOutIf2
hi def link cCppInElse2 cCppOutIf2
hi def link cCppOutIf2 cCppOut
hi def link cCppOut Comment
+hi def link cFunction Function
+hi def link cFunctionPointer Function
let b:current_syntax = "c"