fix: escape file list contents to avoid rendering garbage
This commit is contained in:
parent
ca784d1712
commit
1c087203e0
1 changed files with 1 additions and 9 deletions
|
@ -174,18 +174,10 @@ fn handle_render_menu(self: *Self, button: *Button.State(*Menu.State(*Self)), th
|
|||
.Warning => button.plane.set_style(style_warning),
|
||||
.Error => button.plane.set_style(style_error),
|
||||
}
|
||||
_ = button.plane.print("{s}", .{entry.lines}) catch {};
|
||||
_ = button.plane.print("{s}", .{std.fmt.fmtSliceEscapeLower(entry.lines)}) catch {};
|
||||
return false;
|
||||
}
|
||||
|
||||
fn render_cell(plane: *Plane, y: usize, x: usize, style: Widget.Theme.Style) !void {
|
||||
plane.cursor_move_yx(@intCast(y), @intCast(x)) catch return;
|
||||
var cell = plane.cell_init();
|
||||
_ = plane.at_cursor_cell(&cell) catch return;
|
||||
cell.set_style(style);
|
||||
_ = plane.putc(&cell) catch {};
|
||||
}
|
||||
|
||||
fn handle_scroll(self: *Self, _: tp.pid_ref, m: tp.message) error{Exit}!void {
|
||||
_ = try m.match(.{ "scroll_to", tp.extract(&self.view_pos) });
|
||||
self.update_selected();
|
||||
|
|
Loading…
Add table
Reference in a new issue