feat: add command to toggle syntax highlighting (S-F10)
This commit is contained in:
		
							parent
							
								
									f4dd30b1c2
								
							
						
					
					
						commit
						470967981b
					
				
					 6 changed files with 30 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -58,8 +58,15 @@ pub fn destroy(self: *Self) void {
 | 
			
		|||
    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 {
 | 
			
		||||
    if (self.tree) |tree| tree.destroy();
 | 
			
		||||
    self.reset();
 | 
			
		||||
    self.tree = try self.parser.parseString(null, content);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue