feat: display symbol documentation in info panel in completion_palette

This commit is contained in:
CJ van den Berg 2025-12-08 16:47:19 +01:00
parent e85832c0cb
commit 852f456bf0
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 29 additions and 12 deletions

View file

@ -43,13 +43,17 @@ pub fn handle_resize(self: *Self, pos: Widget.Box) void {
self.view_rows = pos.h;
}
pub fn set_content(self: *Self, content: []const u8) !void {
self.clear();
pub fn append_content(self: *Self, content: []const u8) !void {
var iter = std.mem.splitScalar(u8, content, '\n');
while (iter.next()) |line|
(try self.lines.addOne(self.allocator)).* = try self.allocator.dupe(u8, line);
}
pub fn set_content(self: *Self, content: []const u8) !void {
self.clear();
return self.append_content(content);
}
pub fn render(self: *Self, theme: *const Widget.Theme) bool {
self.plane.set_base_style(theme.panel);
self.plane.erase();