summaryrefslogtreecommitdiff
path: root/src/File.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/File.zig')
-rw-r--r--src/File.zig12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/File.zig b/src/File.zig
index 64614191..d4032171 100644
--- a/src/File.zig
+++ b/src/File.zig
@@ -13,6 +13,7 @@ const filesystem = @import("fs.zig");
const syntax = @import("syntax.zig");
const diff = @import("diff.zig");
const tracy = @import("tracy.zig");
+const ansi = @import("ansi.zig");
const limits = @import("memory.zig").limits;
const locations = @import("locations.zig");
const Colors = @import("colors.zig");
@@ -1831,9 +1832,10 @@ pub fn recolorSyntax(p: *Pardes, s: *Surface, pane: *Pane, f: *State, r: pardes.
// A row whose first byte names a hue (syntax.ground_add, _del): its
// grounds, the theme's, worked out once a frame and only for one.
var grounds: ?Colors.Grounds = null;
+ const ink = ansi.inkOf(p.theme());
var filtered_storage: pardes.Term.Filter = undefined;
const filtered: ?*pardes.Term.Filter = if (pane.tty_filter and spans.len > 0) blk: {
- filtered_storage = .init(p, null);
+ filtered_storage = pardes.Term.filter(&ink, &p.tty_filter_palette);
break :blk &filtered_storage;
} else null;
// indexed start, same as bodyText — an empty tail simply paints nothing
@@ -1957,11 +1959,11 @@ pub fn recolorSyntax(p: *Pardes, s: *Surface, pane: *Pane, f: *State, r: pardes.
// palette colour through the theme's sixteen and
// truecolor as it is.
if (filtered) |colors| {
- if (st.fg != .default) cell.style.fg = colors.spanColor(st.fg, false);
- if (st.bg != .default) cell.style.bg = colors.spanColor(st.bg, true);
+ if (st.fg != .default) cell.style.fg = pardes.Term.spanColor(colors, st.fg, false);
+ if (st.bg != .default) cell.style.bg = pardes.Term.spanColor(colors, st.bg, true);
} else {
- if (st.fg != .default) cell.style.fg = if (st.fg == .index) pardes.Term.palColor(p, st.fg.index) else st.fg;
- if (st.bg != .default) cell.style.bg = if (st.bg == .index) pardes.Term.palColor(p, st.bg.index) else st.bg;
+ if (st.fg != .default) cell.style.fg = if (st.fg == .index) ink.palColor(st.fg.index) else st.fg;
+ if (st.bg != .default) cell.style.bg = if (st.bg == .index) ink.palColor(st.bg.index) else st.bg;
}
cell.style.bold = cell.style.bold or st.bold;
cell.style.dim = st.dim;