From 44e19d2193be2c88c0c0c724d24635d674e94254 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 8 Sep 2025 21:38:13 +0200 Subject: [PATCH 1/8] feat: update multi cursor support for latest kitty --- src/renderer/vaxis/renderer.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/vaxis/renderer.zig b/src/renderer/vaxis/renderer.zig index c065b85..1b93293 100644 --- a/src/renderer/vaxis/renderer.zig +++ b/src/renderer/vaxis/renderer.zig @@ -545,7 +545,7 @@ pub fn clear_all_multi_cursors(self: *Self) !void { } pub fn show_multi_cursor_yx(self: *Self, y: c_int, x: c_int) !void { - try self.tty.anyWriter().print("\x1b[>-1;2:{d}:{d} q", .{ y + 1, x + 1 }); + try self.tty.anyWriter().print("\x1b[>29;2:{d}:{d} q", .{ y + 1, x + 1 }); } fn sync_mod_state(self: *Self, keypress: u32, modifiers: vaxis.Key.Modifiers) !void { From 251c74a23bd7406a1489445f538f0cfc4c30c951 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 8 Sep 2025 22:07:10 +0200 Subject: [PATCH 2/8] feat: set secondary cursors color from theme in multi cursor mode --- src/renderer/vaxis/renderer.zig | 6 ++++++ src/renderer/win32/renderer.zig | 6 ++++++ src/tui/tui.zig | 2 ++ 3 files changed, 14 insertions(+) diff --git a/src/renderer/vaxis/renderer.zig b/src/renderer/vaxis/renderer.zig index 1b93293..5c32bc7 100644 --- a/src/renderer/vaxis/renderer.zig +++ b/src/renderer/vaxis/renderer.zig @@ -6,6 +6,7 @@ const Color = @import("theme").Color; const vaxis = @import("vaxis"); const input = @import("input"); const builtin = @import("builtin"); +const RGB = @import("color").RGB; pub const Plane = @import("Plane.zig"); pub const Cell = @import("Cell.zig"); @@ -456,6 +457,11 @@ pub fn set_terminal_cursor_color(self: *Self, color: Color) void { self.vx.setTerminalCursorColor(self.tty.anyWriter(), vaxis.Cell.Color.rgbFromUint(@intCast(color.color)).rgb) catch {}; } +pub fn set_terminal_secondary_cursor_color(self: *Self, color: Color) void { + const rgb = RGB.from_u24(color.color); + self.tty.anyWriter().print("\x1b[>40;2:{d}:{d}:{d} q", .{ rgb.r, rgb.g, rgb.b }) catch {}; +} + pub fn set_terminal_working_directory(self: *Self, absolute_path: []const u8) void { self.vx.setTerminalWorkingDirectory(self.tty.anyWriter(), absolute_path) catch {}; } diff --git a/src/renderer/win32/renderer.zig b/src/renderer/win32/renderer.zig index 701a631..cd10ed4 100644 --- a/src/renderer/win32/renderer.zig +++ b/src/renderer/win32/renderer.zig @@ -440,6 +440,12 @@ pub fn set_terminal_cursor_color(self: *Self, color: Color) void { //@panic("todo"); } +pub fn set_terminal_secondary_cursor_color(self: *Self, color: Color) void { + _ = self; + _ = color; + //@panic("todo"); +} + pub fn set_terminal_working_directory(self: *Self, absolute_path: []const u8) void { _ = self; _ = absolute_path; diff --git a/src/tui/tui.zig b/src/tui/tui.zig index 7f0c172..a08e55c 100644 --- a/src/tui/tui.zig +++ b/src/tui/tui.zig @@ -1448,6 +1448,8 @@ fn set_terminal_style(self: *Self) void { if (build_options.gui or self.config_.enable_terminal_color_scheme) { self.rdr_.set_terminal_style(self.theme_.editor); self.rdr_.set_terminal_cursor_color(self.theme_.editor_cursor.bg.?); + if (self.rdr_.vx.caps.multi_cursor) + self.rdr_.set_terminal_secondary_cursor_color(self.theme_.editor_cursor_secondary.bg orelse self.theme_.editor_cursor.bg.?); } } From fda9338a06af85966f7d2730415d5e08b633e55f Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 9 Sep 2025 09:24:18 +0200 Subject: [PATCH 3/8] fix: clamp to end of last line if the cursor is past the end of the buffer closes #289 --- src/buffer/Cursor.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/buffer/Cursor.zig b/src/buffer/Cursor.zig index aca5339..9cbf2e8 100644 --- a/src/buffer/Cursor.zig +++ b/src/buffer/Cursor.zig @@ -28,8 +28,12 @@ pub inline fn right_of(self: Self, other: Self) bool { } pub fn clamp_to_buffer(self: *Self, root: Buffer.Root, metrics: Metrics) void { - self.row = @min(self.row, root.lines() - 1); - self.col = @min(self.col, root.line_width(self.row, metrics) catch 0); + if (self.row > root.lines() - 1) { + self.row = root.lines() - 1; + self.col = root.line_width(self.row, metrics) catch 0; + } else { + self.col = @min(self.col, root.line_width(self.row, metrics) catch 0); + } } fn follow_target(self: *Self, root: Buffer.Root, metrics: Metrics) void { From 04951e7e9b00f65f9980039e6fae61e3b646c4c8 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 9 Sep 2025 11:58:19 +0200 Subject: [PATCH 4/8] feat: add support for bracketed file link syntax These file links are produced by MS compilers. e.g: dir/file.cs(12,15): --- src/file_link.zig | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/file_link.zig b/src/file_link.zig index aac4cfa..4d86200 100644 --- a/src/file_link.zig +++ b/src/file_link.zig @@ -21,6 +21,15 @@ pub const DirDest = struct { pub fn parse(link: []const u8) error{InvalidFileLink}!Dest { if (link.len == 0) return error.InvalidFileLink; + + if (std.mem.lastIndexOfScalar(u8, link, '(')) |pos| blk: { + for (link[pos + 1 ..]) |c| switch (c) { + '0'...'9', ',', ')', ':' => continue, + else => break :blk, + }; + return parse_bracket_link(link); + } + var it = std.mem.splitScalar(u8, link, ':'); var dest: Dest = if (root.is_directory(link)) .{ .dir = .{ .path = link } } @@ -46,6 +55,36 @@ pub fn parse(link: []const u8) error{InvalidFileLink}!Dest { return dest; } +pub fn parse_bracket_link(link: []const u8) error{InvalidFileLink}!Dest { + var it_ = std.mem.splitScalar(u8, link, '('); + var dest: Dest = if (root.is_directory(link)) + .{ .dir = .{ .path = link } } + else + .{ .file = .{ .path = it_.first() } }; + + const rest = it_.next() orelse ""; + var it = std.mem.splitAny(u8, rest, ",):"); + + switch (dest) { + .file => |*file| { + if (it.next()) |line_| + file.line = std.fmt.parseInt(usize, line_, 10) catch blk: { + file.path = link; + break :blk null; + }; + if (file.line) |_| if (it.next()) |col_| { + file.column = std.fmt.parseInt(usize, col_, 10) catch null; + }; + if (file.column) |_| if (it.next()) |col_| { + file.end_column = std.fmt.parseInt(usize, col_, 10) catch null; + }; + file.exists = root.is_file(file.path); + }, + .dir => {}, + } + return dest; +} + pub fn navigate(to: tp.pid_ref, link: *const Dest) anyerror!void { switch (link.*) { .file => |file| { From 000aaf968508843a2ccaf16542177670b64d0607 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 9 Sep 2025 12:41:21 +0200 Subject: [PATCH 5/8] fix: ignore trailing whitespace in bracketed file links --- src/file_link.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/file_link.zig b/src/file_link.zig index 4d86200..ec53f39 100644 --- a/src/file_link.zig +++ b/src/file_link.zig @@ -24,7 +24,7 @@ pub fn parse(link: []const u8) error{InvalidFileLink}!Dest { if (std.mem.lastIndexOfScalar(u8, link, '(')) |pos| blk: { for (link[pos + 1 ..]) |c| switch (c) { - '0'...'9', ',', ')', ':' => continue, + '0'...'9', ',', ')', ':', ' ' => continue, else => break :blk, }; return parse_bracket_link(link); From a299d27b1fbe0109903eb3b0e0fa942cb0ec18a1 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 9 Sep 2025 22:30:54 +0200 Subject: [PATCH 6/8] feat: add F# language support closes #291 --- build.zig.zon | 4 ++-- src/file_type_lsp.zig | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 6ae9a7b..8d7f4fb 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -6,8 +6,8 @@ .dependencies = .{ .syntax = .{ - .url = "git+https://github.com/neurocyte/flow-syntax?ref=zig-0.14#bfeb77d62a5e58ec5d2451bdd543619ae26923a2", - .hash = "flow_syntax-0.1.0-X8jOoSkCAQClgFS-j4X7jL-PMJ6LVKdAoNMaHgqJweFL", + .url = "git+https://github.com/neurocyte/flow-syntax?ref=zig-0.14#ba7fc816227ad4f1bb36fbb332d53d28affc64fe", + .hash = "flow_syntax-0.1.0-X8jOoYUDAQDs3XT1lWthyWYF6g4iVpqJdRIWM14ECE50", }, .flags = .{ .url = "https://github.com/n0s4/flags/archive/372501d1576b5723829bcba98e41361132c7b618.tar.gz", diff --git a/src/file_type_lsp.zig b/src/file_type_lsp.zig index a558cc7..1c02e6e 100644 --- a/src/file_type_lsp.zig +++ b/src/file_type_lsp.zig @@ -48,6 +48,10 @@ pub const elixir = .{ pub const fish = .{}; +pub const fsharp = .{ + .language_server = .{"fsautocomplete"}, +}; + pub const @"git-rebase" = .{}; pub const gitcommit = .{}; From bedf91849ad35631421cae809f26377c6253f722 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 11 Sep 2025 09:53:51 +0200 Subject: [PATCH 7/8] feat: add commonlisp file type --- build.zig.zon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 8d7f4fb..ff204e4 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -6,8 +6,8 @@ .dependencies = .{ .syntax = .{ - .url = "git+https://github.com/neurocyte/flow-syntax?ref=zig-0.14#ba7fc816227ad4f1bb36fbb332d53d28affc64fe", - .hash = "flow_syntax-0.1.0-X8jOoYUDAQDs3XT1lWthyWYF6g4iVpqJdRIWM14ECE50", + .url = "git+https://github.com/neurocyte/flow-syntax?ref=zig-0.14#de925265a1dfabe64b96ef922a1c1b13ab55324e", + .hash = "flow_syntax-0.1.0-X8jOoX0EAQBTHdtc4ZaxgdAzVpu-exQ9Bvc4uanjfiyh", }, .flags = .{ .url = "https://github.com/n0s4/flags/archive/372501d1576b5723829bcba98e41361132c7b618.tar.gz", From 79487baa6e89766002f89059fa1c0074327e9fe7 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 11 Sep 2025 10:45:32 +0200 Subject: [PATCH 8/8] feat: update flow-syntax for csproj, and msbuild props file types --- build.zig.zon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index ff204e4..ade034a 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -6,8 +6,8 @@ .dependencies = .{ .syntax = .{ - .url = "git+https://github.com/neurocyte/flow-syntax?ref=zig-0.14#de925265a1dfabe64b96ef922a1c1b13ab55324e", - .hash = "flow_syntax-0.1.0-X8jOoX0EAQBTHdtc4ZaxgdAzVpu-exQ9Bvc4uanjfiyh", + .url = "git+https://github.com/neurocyte/flow-syntax?ref=zig-0.14#c9b46b6b664c36b95e89517e7076265a99840f97", + .hash = "flow_syntax-0.1.0-X8jOoW8HAQDZ7GcM4ZsT-g0V_UdC0LRxunMf8-O-8Uie", }, .flags = .{ .url = "https://github.com/n0s4/flags/archive/372501d1576b5723829bcba98e41361132c7b618.tar.gz",