]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(odin): update syntax/indent scripts
authorMaxim Kim <habamax@gmail.com>
Sun, 7 Jun 2026 17:29:51 +0000 (17:29 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 7 Jun 2026 17:29:51 +0000 (17:29 +0000)
closes: #20438

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/indent/odin.vim
runtime/syntax/odin.vim

index f8e0d3609ed69c5b5ffbe1e0517ab3bd711b2f5c..cba45e9ddffcf09252fe9084dd43c5cf2bc2fae1 100644 (file)
@@ -4,7 +4,7 @@ vim9script
 # Language: Odin
 # Maintainer: Maxim Kim <habamax@gmail.com>
 # Website: https://github.com/habamax/vim-odin
-# Last Change: 2026-02-02
+# Last Change: 2026-06-01
 
 if exists("b:did_indent")
     finish
@@ -105,6 +105,8 @@ 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
+        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:
         # If there is, return indent of the closing }
index 42f3767a436f3d1d14b9233333826a025715c40f..ce961a59fa59e47cc950a53813ee8281f83dd5fe 100644 (file)
@@ -4,34 +4,42 @@ vim9script
 # Language: Odin
 # Maintainer: Maxim Kim <habamax@gmail.com>
 # Website: https://github.com/habamax/vim-odin
-# Last Change: 2026-05-28
+# Last Change: 2026-06-01
 
 if exists("b:current_syntax")
   finish
 endif
 
 syntax keyword odinKeyword using transmute cast auto_cast distinct where dynamic
-syntax keyword odinKeyword struct enum union bit_field bit_set
-syntax keyword odinKeyword package proc map import export foreign
-syntax keyword odinKeyword size_of offset_of type_info_of typeid_of type_of align_of
+syntax keyword odinKeyword struct enum union matrix bit_field bit_set
+syntax keyword odinKeyword package proc map import foreign typeid
 syntax keyword odinKeyword return defer
-syntax keyword odinKeyword inline no_inline
 syntax keyword odinKeyword asm context
 
 syntax keyword odinConditional if when else do for switch case fallthrough
-syntax keyword odinConditional continue or_continue break or_break or_return or_else
-syntax keyword odinType string cstring bool b8 b16 b32 b64 rune any rawptr
-syntax keyword odinType f16 f32 f64 f16le f16be f32le f32be f64le f64be
-syntax keyword odinType u8 u16 u32 u64 u128 u16le u32le u64le u128le u16be
-syntax keyword odinType u32be u64be u128be uint uintptr i8 i16 i32 i64 i128
-syntax keyword odinType i16le i32le i64le i128le i16be i32be i64be i128be
-syntax keyword odinType int complex complex32 complex64 complex128 matrix typeid
-syntax keyword odinType quaternion quaternion64 quaternion128 quaternion256
+syntax keyword odinConditional continue break
+syntax keyword odinConditional or_continue or_break or_return or_else
+
+syntax keyword odinType bool b8 b16 b32 b64
+syntax keyword odinType int i8 i16 i32 i64 i128
+syntax keyword odinType uint u8 u16 u32 u64 u128 uintptr
+syntax keyword odinType i16le i32le i64le i128le u16le u32le u64le u128le
+syntax keyword odinType i16be i32be i64be i128be u16be u32be u64be u128be
+syntax keyword odinType f16 f32 f64
+syntax keyword odinType f16le f32le f64le
+syntax keyword odinType f16be f32be f64be
+syntax keyword odinType complex32 complex64 complex128
+syntax keyword odinType quaternion64 quaternion128 quaternion256
+syntax keyword odinType rune
+syntax keyword odinType string cstring
+syntax keyword odinType rawptr
+syntax keyword odinType any
+
 syntax keyword odinBool true false
 syntax keyword odinNull nil
 syntax match odinUninitialized '\s\+---\(\s\|$\)'
 
-syntax keyword odinOperator in notin not_in
+syntax keyword odinOperator in not_in
 syntax match odinOperator "?" display
 syntax match odinOperator "->" display
 
@@ -43,7 +51,7 @@ syntax match odinTodo "HACK" contained
 syntax region odinRawString start=+`+ end=+`+
 syntax region odinChar start=+'+ skip=+\\\\\|\\'+ end=+'+
 syntax region odinString start=+"+ skip=+\\\\\|\\'+ end=+"+ contains=odinEscape
-syntax match odinEscape display contained /\\\([nrt\\'"]\|x\x\{2}\)/
+syntax match odinEscape display contained /\\\([abefnrtv\\'"]\|\o\{3}\|x\x\{2}\|u\x\{4}\|U\x\{8}\)/
 
 syntax match odinProcedure "\v<\w*>(\s*::\s*proc)@="