Skip to content

Commit e9d296e

Browse files
fixeriachrisbra
authored andcommitted
runtime(erlang): recognize -if/-elif as erlangPreCondit in syntax script
The -if(Condition)/-elif(Condition) are compiler macros that evaluate the following lines only if Condition evaluates to true. This patch enables syntax highlighting for these macros. https://www.erlang.org/doc/system/macros.html#conditional-compilation closes: #18729 Signed-off-by: Vadim Yanitskiy <[email protected]> Signed-off-by: Csaba Hoch <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 9ab6a22 commit e9d296e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

runtime/syntax/erlang.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: Csaba Hoch <[email protected]>
44
" Contributor: Adam Rutkowski <[email protected]>
55
" Johannes Christ <[email protected]>
6-
" Last Update: 2025-Jul-06
6+
" Last Update: 2025-Nov-12
77
" License: Vim license
88
" URL: https://github.com/vim-erlang/vim-erlang-runtime
99

@@ -217,7 +217,7 @@ syn match erlangInnerDocAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(moduledoc\|doc\)\>
217217
syn match erlangInclude '^\s*-\%(\s\|\n\|%.*\n\)*\%(include\|include_lib\)\>' contains=erlangComment
218218
syn match erlangRecordDef '^\s*-\%(\s\|\n\|%.*\n\)*record\>' contains=erlangComment
219219
syn match erlangDefine '^\s*-\%(\s\|\n\|%.*\n\)*\%(define\|undef\)\>' contains=erlangComment
220-
syn match erlangPreCondit '^\s*-\%(\s\|\n\|%.*\n\)*\%(ifdef\|ifndef\|else\|endif\)\>' contains=erlangComment
220+
syn match erlangPreCondit '^\s*-\%(\s\|\n\|%.*\n\)*\%(ifdef\|ifndef\|else\|if\|elif\|endif\)\>' contains=erlangComment
221221
syn match erlangType '^\s*-\%(\s\|\n\|%.*\n\)*\%(spec\|type\|opaque\|nominal\|callback\)\>' contains=erlangComment
222222

223223
" Keywords

0 commit comments

Comments
 (0)