this repo has no description
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: implement middle-click copy

+19 -9
+2 -2
build.zig.zon
··· 7 7 .hash = "12208603e0f51fa6ce7201d8e851c5979b6b78887434623ac87a0f2a5a3dd3e75130", 8 8 }, 9 9 .vaxis = .{ 10 - .url = "git+https://github.com/rockorager/libvaxis#bb5d79ef75f418e3564c12a07e639a835a7568b0", 11 - .hash = "12207097e3c39f054c4c155d6c5b3a485415b21118dcfa19274d7b62cae92f7a007e", 10 + .url = "git+https://github.com/rockorager/libvaxis#55809160b9623de6b2de6eba1fa56cddec4427b3", 11 + .hash = "12209ecb24ac6602e46ad92767dcda3777c2a6cf74d3e51e5e95b599d0ce70d94c62", 12 12 }, 13 13 .zeit = .{ 14 14 .url = "git+https://github.com/rockorager/zeit#d5ce6b6b6336b4dc9c0d1d67339dea81fb4d2e77",
+17 -7
src/App.zig
··· 1685 1685 1686 1686 if (y_off == 0) break; 1687 1687 1688 - var iter = message.paramIterator(); 1689 - // target is the channel, and we already handled that 1690 - _ = iter.next() orelse continue; 1691 - 1692 1688 try self.formatMessageContent(message); 1693 1689 defer self.content_segments.clearRetainingCapacity(); 1694 1690 // print the content first ··· 1709 1705 .height = .{ .limit = height }, 1710 1706 }, 1711 1707 ); 1712 - if (hasMouse(content_win, self.state.mouse)) |_| { 1708 + if (hasMouse(content_win, self.state.mouse)) |mouse| { 1709 + var bg_idx: u8 = 8; 1710 + if (mouse.type == .press and mouse.button == .middle) { 1711 + var list = std.ArrayList(u8).init(self.alloc); 1712 + defer list.deinit(); 1713 + for (self.content_segments.items) |item| { 1714 + try list.appendSlice(item.text); 1715 + } 1716 + try self.vx.copyToSystemClipboard(list.items, self.alloc); 1717 + bg_idx = 3; 1718 + } 1713 1719 content_win.fill(.{ 1714 1720 .char = .{ 1715 1721 .grapheme = " ", 1716 1722 .width = 1, 1717 1723 }, 1718 1724 .style = .{ 1719 - .bg = .{ .index = 8 }, 1725 + .bg = .{ .index = bg_idx }, 1720 1726 }, 1721 1727 }); 1722 1728 for (self.content_segments.items) |*item| { 1723 - item.style.bg = .{ .index = 8 }; 1729 + item.style.bg = .{ .index = bg_idx }; 1724 1730 } 1725 1731 } 1732 + var iter = message.paramIterator(); 1733 + // target is the channel, and we already handled that 1734 + _ = iter.next() orelse continue; 1735 + 1726 1736 const content = iter.next() orelse continue; 1727 1737 if (std.mem.indexOf(u8, content, client.config.nick)) |_| { 1728 1738 for (self.content_segments.items) |*item| {