summaryrefslogtreecommitdiff
path: root/src/locations.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/locations.zig')
-rw-r--r--src/locations.zig8
1 files changed, 3 insertions, 5 deletions
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);
}