Fix off-by-one deinit on DocumentStore

This commit is contained in:
Benjamin Feng 2021-10-23 17:43:20 -05:00 committed by Auguste Rame
parent 088dc570de
commit 0f65093812

View File

@ -190,7 +190,8 @@ fn newDocument(self: *DocumentStore, uri: []const u8, text: [:0]u8) anyerror!*Ha
.document = .{
.uri = uri,
.text = text,
.mem = text,
// Extra +1 to include the null terminator
.mem = text.ptr[0 .. text.len + 1],
},
.tree = tree,
.document_scope = document_scope,