runtime(erlang): recognize -if/-elif as erlangPreCondit in syntax script
Commit:
https://github.com/vim/vim/commit/e9d296e52a6d0cb13d71b36ca60bfb470ce56868
Author: Vadim Yanitskiy <
fix...@osmocom.org>
Date: Wed Nov 12 19:36:46 2025 +0000
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 <
fix...@osmocom.org>
Signed-off-by: Csaba Hoch <
csaba...@gmail.com>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/runtime/syntax/erlang.vim b/runtime/syntax/erlang.vim
index 3ef2c8d41..bbb03d52c 100644
--- a/runtime/syntax/erlang.vim
+++ b/runtime/syntax/erlang.vim
@@ -3,7 +3,7 @@
" Maintainer: Csaba Hoch <
csaba...@gmail.com>
" Contributor: Adam Rutkowski <
h...@mtod.org>
" Johannes Christ <
j...@jchri.st>
-" Last Update: 2025-Jul-06
+" Last Update: 2025-Nov-12
" License: Vim license
" URL:
https://github.com/vim-erlang/vim-erlang-runtime
@@ -217,7 +217,7 @@ syn match erlangInnerDocAttribute '^\s*-\%(\s\|
\|%.*
\)*\%(moduledoc\|doc\)\>
syn match erlangInclude '^\s*-\%(\s\|
\|%.*
\)*\%(include\|include_lib\)\>' contains=erlangComment
syn match erlangRecordDef '^\s*-\%(\s\|
\|%.*
\)*record\>' contains=erlangComment
syn match erlangDefine '^\s*-\%(\s\|
\|%.*
\)*\%(define\|undef\)\>' contains=erlangComment
-syn match erlangPreCondit '^\s*-\%(\s\|
\|%.*
\)*\%(ifdef\|ifndef\|else\|endif\)\>' contains=erlangComment
+syn match erlangPreCondit '^\s*-\%(\s\|
\|%.*
\)*\%(ifdef\|ifndef\|else\|if\|elif\|endif\)\>' contains=erlangComment
syn match erlangType '^\s*-\%(\s\|
\|%.*
\)*\%(spec\|type\|opaque\|nominal\|callback\)\>' contains=erlangComment
" Keywords