Select the types of activity you want to include in your feed.
refactor: rename anyWriter() to writer()
Now that the writer interfaces are no longer generic, the anyWriter term does not make sense. This commit renames it to just writer() to match idiomatic zig usage.
···297297 var vx = try vaxis.init(alloc, .{});
298298 // deinit takes an optional allocator. If your program is exiting, you can
299299 // choose to pass a null allocator to save some exit time.
300300- defer vx.deinit(alloc, tty.anyWriter());
300300+ defer vx.deinit(alloc, tty.writer());
301301302302303303 // The event loop requires an intrusive init. We create an instance with
···317317 defer loop.stop();
318318319319 // Optionally enter the alternate screen
320320- try vx.enterAltScreen(tty.anyWriter());
320320+ try vx.enterAltScreen(tty.writer());
321321322322 // We'll adjust the color index every keypress for the border
323323 var color_idx: u8 = 0;
···329329330330 // Sends queries to terminal to detect certain features. This should always
331331 // be called after entering the alt screen, if you are using the alt screen
332332- try vx.queryTerminal(tty.anyWriter(), 1 * std.time.ns_per_s);
332332+ try vx.queryTerminal(tty.writer(), 1 * std.time.ns_per_s);
333333334334 while (true) {
335335 // nextEvent blocks until an event is in the queue
···365365 // more than one byte will incur an allocation on the first render
366366 // after it is drawn. Thereafter, it will not allocate unless the
367367 // screen is resized
368368- .winsize => |ws| try vx.resize(alloc, tty.anyWriter(), ws),
368368+ .winsize => |ws| try vx.resize(alloc, tty.writer(), ws),
369369 else => {},
370370 }
371371···401401402402 // Render the screen. Using a buffered writer will offer much better
403403 // performance, but is not required
404404- try vx.render(tty.anyWriter());
404404+ try vx.render(tty.writer());
405405 }
406406}
407407```
···36363737 // Use a buffered writer for better performance. There are a lot of writes
3838 // in the render loop and this can have a significant savings
3939- const writer = tty.anyWriter();
3939+ const writer = tty.writer();
40404141 // Initialize Vaxis
4242 var vx = try vaxis.init(alloc, .{
4343 .kitty_keyboard_flags = .{ .report_events = true },
4444 });
4545- defer vx.deinit(alloc, tty.anyWriter());
4545+ defer vx.deinit(alloc, tty.writer());
46464747 var loop: vaxis.Loop(Event) = .{
4848 .vaxis = &vx,
···7171 try writer.flush();
7272 // Sends queries to terminal to detect certain features. This should
7373 // _always_ be called, but is left to the application to decide when
7474- try vx.queryTerminal(tty.anyWriter(), 1 * std.time.ns_per_s);
7474+ try vx.queryTerminal(tty.writer(), 1 * std.time.ns_per_s);
75757676 // The main event loop. Vaxis provides a thread safe, blocking, buffered
7777 // queue which can serve as the primary event queue for an application
···9292 } else if (key.matches('l', .{ .ctrl = true })) {
9393 vx.queueRefresh();
9494 } else if (key.matches('n', .{ .ctrl = true })) {
9595- try vx.notify(tty.anyWriter(), "vaxis", "hello from vaxis");
9595+ try vx.notify(tty.writer(), "vaxis", "hello from vaxis");
9696 loop.stop();
9797 var child = std.process.Child.init(&.{"nvim"}, alloc);
9898 _ = try child.spawnAndWait();
9999 try loop.start();
100100- try vx.enterAltScreen(tty.anyWriter());
100100+ try vx.enterAltScreen(tty.writer());
101101 vx.queueRefresh();
102102 } else if (key.matches(vaxis.Key.enter, .{}) or key.matches('j', .{ .ctrl = true })) {
103103 text_input.clearAndFree();
···121121 // more than one byte will incur an allocation on the first render
122122 // after it is drawn. Thereafter, it will not allocate unless the
123123 // screen is resized
124124- .winsize => |ws| try vx.resize(alloc, tty.anyWriter(), ws),
124124+ .winsize => |ws| try vx.resize(alloc, tty.writer(), ws),
125125 else => {},
126126 }
127127