From 95f41f0eccd27d2823ffd49bc6cd9bf01fadcc4e Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 15 Sep 2026 15:25:11 -0300 Subject: Align search and LSP context locations flush left --- src/locations.zig | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/locations.zig') diff --git a/src/locations.zig b/src/locations.zig index 61bbbd1a..5e588dbe 100644 --- a/src/locations.zig +++ b/src/locations.zig @@ -5,10 +5,10 @@ const syntax = @import("syntax.zig"); const filesystem = @import("fs.zig"); pub const Config = @import("locations_config.zig").Config; -pub const context_prefix = " "; - +/// Legacy marked rows and hidden locations remain recognizable without metadata. +/// Visible context locations are flush left and use Row.kind instead. pub fn isContextLine(line: []const u8) bool { - return std.mem.startsWith(u8, line, context_prefix) or std.mem.startsWith(u8, line, "| "); + return std.mem.startsWith(u8, line, " ") or std.mem.startsWith(u8, line, "| "); } pub const Row = struct { @@ -226,7 +226,6 @@ pub fn format(p: *pardes.Pardes, dir: []const u8, input: []const u8, anchor: ?us for (pending.items, 0..) |row, index| { const before = out.written().len; const context = row.original == null; - if (context) try out.writer.writeAll(context_prefix); try out.writer.writeAll(row.label); const location_end = if (row.hidden) 0 else out.written().len - before; if (row.depth > 0) { @@ -252,7 +251,6 @@ pub fn format(p: *pardes.Pardes, dir: []const u8, input: []const u8, anchor: ?us fn labelWidth(row: Pending) usize { return pardes.panes.File.displayWidth(row.label) + - @as(usize, if (row.original == null) context_prefix.len else 0) + @as(usize, if (row.depth > 0) row.depth + 1 else 0); } -- cgit v1.3