From: Maxim Kim Date: Sun, 7 Jun 2026 17:29:51 +0000 (+0000) Subject: runtime(odin): update syntax/indent scripts X-Git-Tag: v9.2.0601~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5e22756b03d844e34e453c3f991c9b41fa411ca7;p=thirdparty%2Fvim.git runtime(odin): update syntax/indent scripts closes: #20438 Signed-off-by: Maxim Kim Signed-off-by: Christian Brabandt --- diff --git a/runtime/indent/odin.vim b/runtime/indent/odin.vim index f8e0d3609e..cba45e9ddf 100644 --- a/runtime/indent/odin.vim +++ b/runtime/indent/odin.vim @@ -4,7 +4,7 @@ vim9script # Language: Odin # Maintainer: Maxim Kim # 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 } diff --git a/runtime/syntax/odin.vim b/runtime/syntax/odin.vim index 42f3767a43..ce961a59fa 100644 --- a/runtime/syntax/odin.vim +++ b/runtime/syntax/odin.vim @@ -4,34 +4,42 @@ vim9script # Language: Odin # Maintainer: Maxim Kim # 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)@="