diff options
Diffstat (limited to 'src/panes.zig')
| -rw-r--r-- | src/panes.zig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/panes.zig b/src/panes.zig index e21b1dc4..09225068 100644 --- a/src/panes.zig +++ b/src/panes.zig @@ -1095,7 +1095,7 @@ pub const File = struct { if (row.path.len == 0 or row.path.len >= 4096 or row.location_end > row.code_start or row.code_start == 0 or row.code_start > line.len or line[row.code_start - 1] != '\t' or - (row.kind == .context) != locations.isContextLine(line) or + (row.kind == .match and row.location_end == 0) or (row.declaration and row.kind != .context) or row.line > std.math.maxInt(i32) or row.col > std.math.maxInt(i32) or row.end_line > std.math.maxInt(i32) or row.end_col > std.math.maxInt(i32)) @@ -2442,13 +2442,15 @@ pub const Output = struct { return mapped; } - pub fn nextResult(content: []const u8, path: []const u8, at: look.Spot) usize { + pub fn nextResult(content: []const u8, rows: []const locations.Row, path: []const u8, at: look.Spot) usize { const current: Location = .{ .path = path, .at = at, .end = 0 }; var lines = std.mem.splitScalar(u8, content, '\n'); var first: ?usize = null; var row: usize = 0; while (lines.next()) |line| : (row += 1) { - if (locations.isContextLine(line)) continue; + if (row < rows.len) { + if (rows[row].kind != .match) continue; + } else if (locations.isContextLine(line)) continue; const target = location(line); if (target.at.line == 0) continue; if (first == null) first = row; |
