Compare commits
2 commits
1ac34340b4
...
eb72f06be1
| Author | SHA1 | Date | |
|---|---|---|---|
| eb72f06be1 | |||
| 15b600b570 |
2 changed files with 4 additions and 4 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 {
|
||||||
|
|
|
||||||
|
|
@ -591,7 +591,7 @@ fn dispatch_mouse(ctx: *anyopaque, y: c_int, x: c_int, cbor_msg: []const u8) voi
|
||||||
send_func(self, y, x, from, m) catch |e| self.logger.err("dispatch mouse", e);
|
send_func(self, y, x, from, m) catch |e| self.logger.err("dispatch mouse", e);
|
||||||
var btn: input.MouseType = 0;
|
var btn: input.MouseType = 0;
|
||||||
_ = m.match(.{ tp.string, tp.any, tp.extract(&btn), tp.more }) catch false;
|
_ = m.match(.{ tp.string, tp.any, tp.extract(&btn), tp.more }) catch false;
|
||||||
self.maybe_reset_drag_source_internal(btn);
|
self.maybe_reset_drag_source(btn);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dispatch_mouse_drag(ctx: *anyopaque, y: c_int, x: c_int, cbor_msg: []const u8) void {
|
fn dispatch_mouse_drag(ctx: *anyopaque, y: c_int, x: c_int, cbor_msg: []const u8) void {
|
||||||
|
|
@ -1461,7 +1461,7 @@ pub fn reset_drag_context() void {
|
||||||
self.drag_button = 0;
|
self.drag_button = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn maybe_reset_drag_source_internal(self: *Self, btn: input.MouseType) void {
|
fn maybe_reset_drag_source(self: *Self, btn: input.MouseType) void {
|
||||||
if (self.drag_button != btn) return;
|
if (self.drag_button != btn) return;
|
||||||
self.drag_source = null;
|
self.drag_source = null;
|
||||||
self.drag_button = 0;
|
self.drag_button = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue