Commit: runtime(odin): update syntax, indent

Christian Brabandt <[email protected]>
Newsgroups gmane.editors.vim.devel
Message-ID <[email protected]>
runtime(odin): update syntax, indent

Commit: https://github.com/vim/vim/commit/58e44cfbcafa5b2067316b56d22964623341981a
Author: Maxim Kim <[email protected]>
Date:   Mon Aug 17 17:54:47 2026 +0000

    runtime(odin): update syntax, indent
    
    - syntax: highlight attributes, e.g. @static, @(static), @(someattribute ....)
    - indent: fix incorrect case: indent if previous case: has oneliner as `if ... do ...`
    
    closes: #21067
    
    Signed-off-by: Maxim Kim <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/indent/odin.vim b/runtime/indent/odin.vim
index e7bc4b541..7b24ad218 100644
--- a/runtime/indent/odin.vim
+++ b/runtime/indent/odin.vim
@@ -4,7 +4,7 @@ vim9script
 # Language: Odin
 # Maintainer: Maxim Kim <[email protected]>
 # Website: https://github.com/habamax/vim-odin
-# Last Change: 2026-06-28
+# Last Change: 2026 Aug 17
 
 if exists("b:did_indent")
     finish
@@ -109,7 +109,9 @@ def GetOdinIndent(lnum: number): number
         endfor
     elseif pline =~ '{[^{]*}\s*$' && line !~ '^\s*[})]\s*$' # https://github.com/habamax/vim-odin/issues/2
         indent = pindent
-    elseif line !~ '^\s*}' && pline =~ '^\s*\%(if\|for\).*\s\+do\%(\s\+\|$\)' # https://github.com/habamax/vim-odin/issues/15
+    elseif line !~ '^\s*}'
+            && line !~ '^\s*case\s\+.\{-}:'
+            && pline =~ '^\s*\%(if\|for\).*\s\+do\%(\s\+\|$\)' # https://github.com/habamax/vim-odin/issues/15
         indent = pindent
     elseif pline =~ '^\s*}\s*$' # https://github.com/habamax/vim-odin/issues/3
         # Find line with opening { and check if there is a label:
diff --git a/runtime/indent/testdir/odin.in b/runtime/indent/testdir/odin.in
index 22e358fa6..faf1b25cc 100644
--- a/runtime/indent/testdir/odin.in
+++ b/runtime/indent/testdir/odin.in
@@ -1317,7 +1317,7 @@ switch f {
 case .A:
 fmt.println("HITHER")
 case .B:
-fmt.println("NEVER")
+if true do fmt.println("NEVER")
 case .C:
 fmt.println("FOREVER")
 }
diff --git a/runtime/indent/testdir/odin.ok b/runtime/indent/testdir/odin.ok
index 2e0aba77a..47494b5bc 100644
--- a/runtime/indent/testdir/odin.ok
+++ b/runtime/indent/testdir/odin.ok
@@ -1317,7 +1317,7 @@ implicit_selector_expression :: proc() {
     case .A:
         fmt.println("HITHER")
     case .B:
-        fmt.println("NEVER")
+        if true do fmt.println("NEVER")
     case .C:
         fmt.println("FOREVER")
     }
diff --git a/runtime/syntax/odin.vim b/runtime/syntax/odin.vim
index ce961a59f..e8aa1f875 100644
--- a/runtime/syntax/odin.vim
+++ b/runtime/syntax/odin.vim
@@ -4,7 +4,7 @@ vim9script
 # Language: Odin
 # Maintainer: Maxim Kim <[email protected]>
 # Website: https://github.com/habamax/vim-odin
-# Last Change: 2026-06-01
+# Last Change: 2026 Aug 16
 
 if exists("b:current_syntax")
   finish
@@ -55,11 +55,13 @@ syntax match odinEscape display contained /\\([abefnrtv\'"]\|\o\{3}\|x\x\{2}\|
 
 syntax match odinProcedure " <\w*>(\s*::\s*proc)@="
 
-syntax match odinAttribute "@\ze\<\w\+\>" display
-syntax region odinAttribute
+syntax match odinAttribute "@" display nextgroup=odinAttributeName,odinAttributeBraces
+syntax match odinAttributeName "\<\w\+\>" display contained
+syntax region odinAttributeBraces
       \ matchgroup=odinAttribute
-      \ start="@\ze(" end="\ze)"
+      \ start="(\w\+" end=")"
       \ transparent oneline
+      \ contained
 
 syntax match odinInteger " -?<[0-9]+%(_[0-9]+)*>" display
 syntax match odinFloat " -?<[0-9]+%(_[0-9]+)*%(\.[0-9]+%(_[0-9]+)*)%([eE][+-]=[0-9]+%(_[0-9]+)*)=" display
@@ -98,13 +100,14 @@ highlight def link odinBlockComment Comment
 
 highlight def link odinTodo Todo
 
-highlight def link odinAttribute Statement
+highlight def link odinAttribute PreProc
+highlight def link odinAttributeName odinAttribute
 highlight def link odinType Type
 highlight def link odinBool Boolean
 highlight def link odinNull Constant
 highlight def link odinUninitialized Constant
-highlight def link odinInteger Number
 highlight def link odinFloat Float
+highlight def link odinInteger Number
 highlight def link odinHex Number
 highlight def link odinOct Number
 highlight def link odinBin Number

-- 
-- 
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/E1ww1d1-008qqO-Gq%40256bit.org.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.