~rockorager/comlink

ui: add /redraw command and default binding to redraw screen v1 PROPOSED

Gregory Anders: 1
 ui: add /redraw command and default binding to redraw screen

 1 files changed, 10 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~rockorager/comlink/patches/53993/mbox | git am -3
Learn more about email & git

[PATCH] ui: add /redraw command and default binding to redraw screen Export this patch

This is useful if the screen state becomes garbled for any reason (e.g.
error messages printing to stderr).
---
 src/App.zig | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/App.zig b/src/App.zig
index f5b22f9..fe53fbc 100644
--- a/src/App.zig
+++ b/src/App.zig
@@ -154,6 +154,13 @@ pub fn init(alloc: std.mem.Allocator) !App {
        },
        .command = .@"next-channel",
    });
    try app.binds.append(.{
        .key = .{
            .codepoint = 'l',
            .mods = .{ .ctrl = true },
        },
        .command = .redraw,
    });

    // Get our system tls certs
    try app.bundle.rescan(alloc);
@@ -299,6 +306,7 @@ pub fn run(self: *App) !void {
                                .quit => self.should_quit = true,
                                .@"next-channel" => self.nextChannel(),
                                .@"prev-channel" => self.prevChannel(),
                                .redraw => self.vx.queueRefresh(),
                                else => {},
                            }
                            break;
@@ -1274,6 +1282,7 @@ pub const Command = enum {
    names,
    part,
    close,
    redraw,

    /// if we should append a space when completing
    pub fn appendSpace(self: Command) bool {
@@ -1403,6 +1412,7 @@ pub fn handleCommand(self: *App, buffer: Buffer, cmd: []const u8) !void {
            );
            return self.queueWrite(client, msg);
        },
        .redraw => self.vx.queueRefresh(),
    }
}

-- 
2.45.2
Reviewed-by: Tristan Partin <tristan@partin.io>