diff options
Diffstat (limited to 'core/Stream.zig')
| -rw-r--r-- | core/Stream.zig | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/Stream.zig b/core/Stream.zig index 7956e4f2..c231d413 100644 --- a/core/Stream.zig +++ b/core/Stream.zig @@ -363,8 +363,9 @@ pub fn paintRows(p: *Pardes, path: []const u8) void { if (s.rows_paint != null or !p.tape.has(p, .search)) return; var content: ?[]const u8 = null; var revision: u32 = 0; - for (p.panes) |slot| if (slot) |pane| if (pane.file) |f| if (f.output == null and std.mem.eql(u8, f.path, path)) { - content = f.content; + for (p.panes) |slot| if (slot) |pane| if (pane.file) |*f| if (f.output == null and std.mem.eql(u8, f.path, path)) { + // The file's text: the `Changes` layer's lines are none of it. + content = panes.File.fileText(f, p.scratch.allocator()) catch return; revision = f.revision; break; }; @@ -459,7 +460,9 @@ pub fn parseFor(p: *Pardes, id: usize) void { } const workers = p.tape.has(p, .search) and !p.fs.serving; if (!workers and f.content.len > 64 << 10) return; - const job = TextJob.make(p.gpa, pane.serial, f.revision, 0, f.path, f.content) orelse return; + // The file's text parsed: the `Changes` layer's lines are none of it. + const text = panes.File.fileText(&f, p.scratch.allocator()) catch return; + const job = TextJob.make(p.gpa, pane.serial, f.revision, 0, f.path, text) orelse return; s.gen +%= 1; s.parse_gen = s.gen; job.gen = s.parse_gen; |
