fix: clipboard_palette does not paste the selected item
This commit is contained in:
parent
1ac34340b4
commit
15b600b570
1 changed files with 2 additions and 2 deletions
|
|
@ -86,11 +86,11 @@ fn select(menu: **Type.MenuType, button: *Type.ButtonType, _: Type.Pos) void {
|
||||||
while (len > 0) : (len -= 1)
|
while (len > 0) : (len -= 1)
|
||||||
cbor.skipValue(&iter) catch return;
|
cbor.skipValue(&iter) catch return;
|
||||||
if (!(cbor.matchValue(&iter, cbor.extract(&idx)) catch false)) return;
|
if (!(cbor.matchValue(&iter, cbor.extract(&idx)) catch false)) return;
|
||||||
tp.self_pid().send(.{ "cmd", "exit_overlay_mode" }) catch |e| menu.*.opts.ctx.logger.err("navigate", e);
|
tp.self_pid().send(.{ "cmd", "exit_overlay_mode" }) catch |e| menu.*.opts.ctx.logger.err("clipboard_palette", e);
|
||||||
|
|
||||||
const history = tui.clipboard_get_history() orelse return;
|
const history = tui.clipboard_get_history() orelse return;
|
||||||
if (history.len <= idx) return;
|
if (history.len <= idx) return;
|
||||||
tp.self_pid().send(.{ "cmd", "paste", .{history[idx]} }) catch {};
|
tp.self_pid().send(.{ "cmd", "paste", .{history[idx].text} }) catch {};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn delete_item(menu: *Type.MenuType, button: *Type.ButtonType) bool {
|
pub fn delete_item(menu: *Type.MenuType, button: *Type.ButtonType) bool {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue