From Gregory Anders to ~whynothugo/lsp_lines.nvim
The ability to use virtual lines (not just virtual text) for diagnostics is something I'd like to see added as a builtin option for Neovim's diagnostics. Before attempting to implement this myself, I wanted to see if you'd be interested in upstreaming some form of your plugin to Neovim? If so, we can have a more detailed discussion on what features exactly should be included. But if you're not interested I understand, like I said I just wanted to run the idea by you. Thanks! Greg
From Gregory Anders to ~rockorager/comlink
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", }); [message trimmed]
From Gregory Anders to ~rockorager/comlink
/close is an alias. --- src/App.zig | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/App.zig b/src/App.zig index 5d0e864..f5b22f9 100644 --- a/src/App.zig +++ b/src/App.zig @@ -786,7 +786,7 @@ pub fn run(self: *App) !void { if (std.mem.indexOf(u8, content, msg.client.config.nick)) |_| { var buf: [64]u8 = undefined; const title_or_err = if (msg.source) |source| std.fmt.bufPrint(&buf, "{s} - {s}", .{channel.name, source })[message trimmed]
From Gregory Anders to ~rockorager/comlink
--- src/App.zig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/App.zig b/src/App.zig index 20912f4..5d0e864 100644 --- a/src/App.zig +++ b/src/App.zig @@ -784,7 +784,17 @@ pub fn run(self: *App) !void { const content = iter.next() orelse continue; var has_highlight = false; if (std.mem.indexOf(u8, content, msg.client.config.nick)) |_| { try self.vx.notify(writer, "comlink", content); var buf: [64]u8 = undefined;[message trimmed]
From Gregory Anders to ~rockorager/comlink
The IRC specification does not mention an explicit channel name length [1], but I found that Libera.Chat does enforce a length of around 48 characters. So the 64 byte buffer should be plenty in most cases, but just in case we truncate the channel name (and drop the " - comlink" suffix) if the channel name is too long. [1]: https://modern.ircdocs.horse/#channels --- v3: - Forgot to include the link to the spec src/App.zig | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) [message trimmed]
From Gregory Anders to ~rockorager/comlink
The IRC specification does not mention an explicit channel name length
[1], but I found that Libera.Chat does enforce a length of around 48
characters. So the 64 byte buffer should be plenty in most cases, but
just in case we truncate the channel name (and drop the " - comlink"
suffix) if the channel name is too long.
---
I tested this by changing the buffer size to 32 bytes and joining
#somechannelwithareallyreallyreallyreallylongname and verified that the
channel name was correctly truncated in the window title.
v2:
- Update commit message
- Truncate channel name if it's too long
[message trimmed]
From Gregory Anders to ~rockorager/comlink
On Tue Jul 16, 2024 at 4:13 PM CDT, Tim Culverhouse wrote: > > Is channel always < 54 chars?? Libera at least enforces a ~48 character max (many error code 479s were encountered to discover this). The spec doesn't mention anything about channel name limits though: https://modern.ircdocs.horse/#channels. So to be safe, we can truncate the channel name if it's longer than 64 characters.
From Gregory Anders to ~rockorager/comlink
--- src/App.zig | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/App.zig b/src/App.zig index 7e7e0c1..5169ab2 100644 --- a/src/App.zig +++ b/src/App.zig @@ -1532,7 +1532,9 @@ fn draw(self: *App) !void { self.loop.?.postEvent(.redraw); } } var chan_style: vaxis.Style = if (row == self.state.buffers.selected_idx) [message trimmed]
From Gregory Anders to ~rockorager/comlink
On Tue Jul 16, 2024 at 1:23 PM CDT, Tim Culverhouse wrote: > Minor nit: could you add the explicit type here? Makes it easier for > me to read > without having to find what type the block breaks with > > const time_gap: bool = ... > > > The rest looks good! No problem, v2 sent.
From Gregory Anders to ~rockorager/comlink
--- v2: - Add explicit type annotation to time_gap block src/App.zig | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/App.zig b/src/App.zig index d5bcba7..7e7e0c1 100644 --- a/src/App.zig +++ b/src/App.zig @@ -1686,6 +1686,7 @@ fn draw(self: *App) !void { }); [message trimmed]