feat: add command to toggle syntax highlighting (S-F10)
This commit is contained in:
parent
b31fb25478
commit
57dfa2ee9f
1 changed files with 8 additions and 1 deletions
|
@ -58,8 +58,15 @@ pub fn destroy(self: *Self) void {
|
||||||
self.allocator.destroy(self);
|
self.allocator.destroy(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn reset(self: *Self) void {
|
||||||
|
if (self.tree) |tree| {
|
||||||
|
tree.destroy();
|
||||||
|
self.tree = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn refresh_full(self: *Self, content: []const u8) !void {
|
pub fn refresh_full(self: *Self, content: []const u8) !void {
|
||||||
if (self.tree) |tree| tree.destroy();
|
self.reset();
|
||||||
self.tree = try self.parser.parseString(null, content);
|
self.tree = try self.parser.parseString(null, content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue