From 9eece0985b015b5ca3009d3945246db67d415b5b Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Fri, 26 Mar 2021 21:14:47 +0200 Subject: [PATCH] Fixed crash while typing error. --- src/semantic_tokens.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/semantic_tokens.zig b/src/semantic_tokens.zig index 9a896cc..e5b7b1d 100644 --- a/src/semantic_tokens.zig +++ b/src/semantic_tokens.zig @@ -523,7 +523,9 @@ fn writeNodeTokens( try gap_highlighter.end(lastToken(tree, node)); }, .error_value => { - try writeToken(builder, datas[node].lhs - 1, .keyword); + if (datas[node].lhs != 0) { + try writeToken(builder, datas[node].lhs - 1, .keyword); + } try writeToken(builder, datas[node].rhs, .errorTag); }, .identifier => {