Skip to content

Commit 267754a

Browse files
committed
Add syntax highlighting for a few "for_each" variants
Assign "cRepeat" highlighting group to for_each[_*] macros. Recognized prefixes are "device_", "hlist_" and "list_". The match should only trigger if for_each is preceded by whitespace only, to avoid triggering on their own "#define"s. Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 626dd6f commit 267754a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

plugin/linuxsty.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ function s:LinuxHighlighting()
105105
" include/linux/compiler_attributes.h for why.
106106
syn match LinuxError /\<__deprecated\>/
107107

108+
" highlight various for_each() variants
109+
syn match cRepeat /\v^\s*\zs((h)?list_|device_)?for_each(_\w+)?(\()@=/
110+
108111
" Highlight trailing whitespace, unless we're in insert mode and the
109112
" cursor's placed right after the whitespace. This prevents us from having
110113
" to put up with whitespace being highlighted in the middle of typing

0 commit comments

Comments
 (0)