summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index 4c6fc367..92df2645 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -73,8 +73,8 @@ pub const PaneKind = enum {
return switch (kind) {
.terminal => pane.isTerminal(),
.pdf => pane.hasPdf(),
- .image => pane.image != null,
- .picture => pane.image != null or pane.isTerminal(),
+ .image => pane.addon != null,
+ .picture => pane.addon != null or pane.isTerminal(),
.program_colors => pane.isTerminal() or (pane.file != null and pane.file.?.pager),
.diff => if (pane.file) |f| pane.colorAlgo() == .diff or
(f.output != null and std.meta.eql(f.output.?.from, panes.Output.Origin{ .cmd = .Diff })) else false,
@@ -996,12 +996,12 @@ pub const Petscii = struct {
pub const takes_arg = true;
pub fn run(c: Ctx) void {
// `on|off` sets it, as the tag's `petscii:on` reads; none flips it.
- const now = if (c.pane.image) |state| state.glyph_art else panes.terminal.petscii(c.pane) orelse false;
+ const now = if (c.pane.addon) |k| k.art.glyph else panes.terminal.petscii(c.pane) orelse false;
if (c.arg != null) {
const want = stateArg(c, OnOff, "Petscii", "on or off") orelse return;
if ((want == .on) == now) return;
}
- if (c.pane.image) |*state| state.glyph_art = !state.glyph_art;
+ if (c.pane.addon) |k| k.art.glyph = !k.art.glyph;
panes.terminal.togglePetscii(c.pane);
}
};
@@ -1011,12 +1011,12 @@ pub const Palette = struct {
pub const needs: PaneKind = .image;
pub const takes_arg = true;
pub fn run(c: Ctx) void {
- const state = &(c.pane.image orelse return);
+ const art = &(c.pane.addon orelse return).art;
if (c.arg != null) {
const want = stateArg(c, panes.Image.PaletteMode, "Palette", "commodore or terminal") orelse return;
- if (want == state.pmode) return;
+ if (want == art.palette) return;
}
- state.pmode = if (state.pmode == .commodore) .terminal else .commodore;
+ art.palette = if (art.palette == .commodore) .terminal else .commodore;
}
};
@@ -1025,12 +1025,12 @@ pub const Ascii = struct {
pub const needs: PaneKind = .image;
pub const takes_arg = true;
pub fn run(c: Ctx) void {
- const state = &(c.pane.image orelse return);
+ const art = &(c.pane.addon orelse return).art;
if (c.arg != null) {
const want = stateArg(c, OnOff, "Ascii", "on or off") orelse return;
- if ((want == .on) == state.ascii) return;
+ if ((want == .on) == art.ascii) return;
}
- state.ascii = !state.ascii;
+ art.ascii = !art.ascii;
}
};