refactor: add detail to info in completion palette

This commit is contained in:
CJ van den Berg 2025-12-08 18:04:37 +01:00
parent 1c0e66d477
commit 15e96d9136
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -186,12 +186,14 @@ fn select(menu: **Type.MenuType, button: *Type.ButtonType, _: Type.Pos) void {
pub fn updated(palette: *Type, button_: ?*Type.ButtonType) !void {
const button = button_ orelse return cancel(palette);
_, _, _, const replace, _, _, _, const detail, const documentation = get_values(button.opts.label);
const label_, _, _, const replace, _, _, _, const detail, const documentation = get_values(button.opts.label);
const editor = tui.get_active_editor() orelse return error.NotFound;
editor.get_primary().selection = get_replace_selection(replace);
const mv = tui.mainview() orelse return;
try mv.set_info_content(detail, .replace);
try mv.set_info_content(label_, .replace);
try mv.set_info_content(" ", .append); // blank line
try mv.set_info_content(detail, .append);
try mv.set_info_content(" ", .append); // blank line
try mv.set_info_content(documentation, .append);
}