Commit: runtime(odin): update indent and syntax scripts

1 view
Skip to first unread message

Christian Brabandt

unread,
5:31 AM (14 hours ago) 5:31 AM
to vim...@googlegroups.com
runtime(odin): update indent and syntax scripts

Commit: https://github.com/vim/vim/commit/c50be218cd4d8dc6cb8cea0d29d45dae719194f7
Author: Maxim Kim <hab...@gmail.com>
Date: Mon Feb 2 10:16:36 2026 +0000

runtime(odin): update indent and syntax scripts

- fix indent of a closing } after another } on previous line
- fix indent of consequent #+feature lines
- highlight #+features

closes: #19310

Signed-off-by: Maxim Kim <hab...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/indent/odin.vim b/runtime/indent/odin.vim
index 50284f4ca..f8e0d3609 100644
--- a/runtime/indent/odin.vim
+++ b/runtime/indent/odin.vim
@@ -4,7 +4,7 @@ vim9script
# Language: Odin
# Maintainer: Maxim Kim <hab...@gmail.com>
# Website: https://github.com/habamax/vim-odin
-# Last Change: 2025-10-15
+# Last Change: 2026-02-02

if exists("b:did_indent")
finish
@@ -61,7 +61,9 @@ def GetOdinIndent(lnum: number): number
var indent = cindent(lnum)
var line = getline(lnum)

- if line =~ '^\s*#\k\+'
+ if line =~ '^\s*#+\k'
+ indent = pindent
+ elseif line =~ '^\s*#\k\+'
if pline =~ '[{:]\s*$'
indent = pindent + shiftwidth()
else
@@ -79,7 +81,7 @@ def GetOdinIndent(lnum: number): number
endif
elseif pline =~ '^\s*@.*' && line !~ '^\s*}'
indent = pindent
- elseif pline =~ ':[:=].*}\s*$'
+ elseif pline =~ ':[:=].*}\s*$' && line !~ '^\s*}'
indent = pindent
elseif pline =~ '^\s*}\s*$'
if line !~ '^\s*}' && line !~ '\<case\>\s*.*:\s*$'
diff --git a/runtime/syntax/odin.vim b/runtime/syntax/odin.vim
index 41d6ca1c4..efa107b79 100644
--- a/runtime/syntax/odin.vim
+++ b/runtime/syntax/odin.vim
@@ -4,7 +4,7 @@ vim9script
# Language: Odin
# Maintainer: Maxim Kim <hab...@gmail.com>
# Website: https://github.com/habamax/vim-odin
-# Last Change: 2025-12-06
+# Last Change: 2026-02-02

if exists("b:current_syntax")
finish
@@ -64,6 +64,7 @@ syntax match odinAddressOf "&" display
syntax match odinDeref "\^" display

syntax match odinMacro "#\<\w\+\>" display
+syntax region odinFeature matchgroup=odinMacro start="#+\<\w\+\>" end="$" oneline display

syntax match odinTemplate "$\<\w\+\>"

Reply all
Reply to author
Forward
0 new messages