runtime(erlang): recognize -if/-elif as erlangPreCondit in syntax script
Commit:
https://github.com/vim/vim/commit/e9d296e52a6d0cb13d71b36ca60bfb470ce56868
Author: Vadim Yanitskiy <[email protected]>
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 <[email protected]>
Signed-off-by: Csaba Hoch <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
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 <[email protected]>
" Contributor: Adam Rutkowski <[email protected]>
" Johannes Christ <[email protected]>
-" 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
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1vJWPS-001DQc-9b%40256bit.org.