Fixed crash while typing error.

This commit is contained in:
Alexandros Naskos 2021-03-26 21:14:47 +02:00
parent 2fd8ab7626
commit 9eece0985b
No known key found for this signature in database
GPG Key ID: 02BF2E72B0EA32D2

View File

@ -523,7 +523,9 @@ fn writeNodeTokens(
try gap_highlighter.end(lastToken(tree, node)); try gap_highlighter.end(lastToken(tree, node));
}, },
.error_value => { .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); try writeToken(builder, datas[node].rhs, .errorTag);
}, },
.identifier => { .identifier => {