Skip to content

Commit e08755b

Browse files
committed
map all error related keywords to zigException
The `error` keyword has two different appearances in sytnax that should be differentiated between. For now, this keyword remains mapped twice which isn't correct. I have tested these changes with the following colorschemes: - folke/tokyonight.nvim - morhetz/gruvbox - catppuccin/nvim - joshdick/onedark.vim - Neovim's "vim" colorscheme All of themes appear to map "Exception" to "Statement" which matches well with other keywords in said group.
1 parent c2be0fc commit e08755b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

syntax/zig.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ syntax keyword zigConditional if else switch
2121
syntax keyword zigRepeat while for
2222
syntax keyword zigComparatorWord and or orelse
2323
syntax keyword zigStructure struct enum union error packed opaque
24-
syntax keyword zigException error
24+
syntax keyword zigException catch error try
2525
syntax keyword zigAccessModifier pub
2626
syntax keyword zigStorageClass addrspace align allowzero callconv extern export linksection threadlocal volatile
2727
syntax keyword zigDummyVariable _
28-
syntax keyword zigKeyword var const fn try test comptime usingnamespace
28+
syntax keyword zigKeyword var const fn test comptime usingnamespace
2929
syntax keyword zigStatement return break continue asm defer errdefer
3030
syntax keyword zigAsync async nosuspend await suspend resume
31-
syntax keyword zigPreProc catch inline noalias noinline
31+
syntax keyword zigPreProc inline noalias noinline
3232
syntax keyword zigBuiltinFn @addrSpaceCast @addWithOverflow @alignCast @alignOf @as @atomicLoad @atomicRmw @atomicStore @bitCast @bitOffsetOf @bitSizeOf @branchHint @breakpoint @mulAdd @byteSwap @bitReverse @offsetOf @call @cDefine @cImport @cInclude @clz @cmpxchgStrong @cmpxchgWeak @compileError @compileLog @constCast @ctz @cUndef @cVaArg @cVaCopy @cVaEnd @cVaStart @disableInstrumentation @disableIntrinsics @divExact @divFloor @divTrunc @embedFile @enumFromInt @errorFromInt @errorName @errorReturnTrace @errorCast @export @extern @field @fieldParentPtr @FieldType @floatCast @floatFromInt @frameAddress @hasDecl @hasField @import @inComptime @intCast @intFromBool @intFromEnum @intFromError @intFromFloat @intFromPtr @max @memcpy @memmove @memset @min @wasmMemorySize @wasmMemoryGrow @mod @mulWithOverflow @panic @popCount @prefetch @ptrCast @ptrFromInt @rem @returnAddress @select @setEvalBranchQuota @setFloatMode @setRuntimeSafety @shlExact @shlWithOverflow @shrExact @shuffle @sizeOf @splat @reduce @src @sqrt @sin @cos @tan @exp @exp2 @log @log2 @log10 @abs @floor @ceil @trunc @round @subWithOverflow @tagName @This @trap @truncate @Type @typeInfo @typeName @TypeOf @unionInit @Vector @volatileCast @workGroupId @workGroupSize @workItemId
3333

3434
syntax match zigType "\v<[iu][1-9]\d*>"

0 commit comments

Comments
 (0)