summaryrefslogtreecommitdiff
path: root/core/Core.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Core.zig')
-rw-r--r--core/Core.zig26
1 files changed, 12 insertions, 14 deletions
diff --git a/core/Core.zig b/core/Core.zig
index d5a990e2..9a542940 100644
--- a/core/Core.zig
+++ b/core/Core.zig
@@ -72,7 +72,6 @@ const lsp = pardes.lsp;
const memory = pardes.memory;
const modal = pardes.modal;
const mouse = pardes.mouse;
-const newer_build_words = pardes.newer_build_words;
const platform = pardes.platform;
const recent_files = @import("recent.zig");
const sel_slot = pardes.sel_slot;
@@ -288,7 +287,7 @@ session_home: [limits.host_path_cap]u8 = undefined,
session_home_len: ?u16 = null,
session_shell: [limits.host_path_cap]u8 = undefined,
session_shell_len: u16 = 0,
-settings: config.Runtime = .{ .font = .{ .tagline_percent = config.gui_tagline_font_percent } },
+settings: config.Settings = .{ .font = .{ .tagline_percent = config.gui_tagline_font_percent } },
locations_config: locations.Config = .{},
locations_cache: locations.Cache = .{},
tty_filter_palette: pardes.Term.FilterPalette = .{},
@@ -296,10 +295,10 @@ font_request_taken: bool = false,
custom_theme: ?Theme = null,
/// bodyChrome's: the theme it was worked out for, and it.
body_chrome: ?struct { theme: Theme, chrome: ChromeTheme } = null,
-theme_file_path: config.Runtime.Text(limits.host_path_cap) = .{},
+theme_file_path: config.Settings.Text(limits.host_path_cap) = .{},
/// The ThemeFile last loaded whole: what /ctl and DumpConfig name, and
/// what a failed ThemeFile goes back to (colors.revertThemeFile).
-theme_file_loaded: config.Runtime.Text(limits.host_path_cap) = .{},
+theme_file_loaded: config.Settings.Text(limits.host_path_cap) = .{},
theme_file_generation: u32 = 0,
theme_file_pane: u8 = 0,
chrome: colors.ChromeTheme = colors.initial_chrome,
@@ -1102,7 +1101,7 @@ fn observeFontInner(
p: *Pardes,
effective_name: []const u8,
effective_size_hundredths: u16,
- unit: config.Runtime.FontSizeUnit,
+ unit: config.Settings.FontSizeUnit,
) bool {
if (!p.settings.font.effective_name.set(effective_name)) return false;
p.settings.font.effective_size_hundredths = effective_size_hundredths;
@@ -1117,7 +1116,7 @@ fn acknowledgeFontInner(
p: *Pardes,
effective_name: []const u8,
effective_size_hundredths: u16,
- unit: config.Runtime.FontSizeUnit,
+ unit: config.Settings.FontSizeUnit,
) bool {
if (!p.settings.font.pending or !p.font_request_taken) return false;
const changed = !std.mem.eql(
@@ -1175,6 +1174,7 @@ fn openViewInner(p: *Pardes) ?View.Id {
// tape does it here: a join dumps the session next, and a core
// loaded from a dump has no queue (Replica.initDump).
p.settle();
+ pardes.panes.reloadTerminals(p);
p.needs_frame = true;
return .at(Views.open(p) orelse return null);
}
@@ -1217,6 +1217,7 @@ fn rejoinViewInner(p: *Pardes, k: View.Id) bool {
if (!Views.isAway(p, k.index())) return false;
p.views_away &= ~(@as(u8, 1) << @intCast(k.index()));
p.settle();
+ pardes.panes.reloadTerminals(p);
p.needs_frame = true;
return true;
}
@@ -1704,10 +1705,7 @@ fn updateInner(p: *Pardes, ev: Event) void {
edit.applyPaste(p, bytes) catch |err| p.reportError(.at(v.active), "paste", err);
},
.command => |line| _ = p.executeBuiltinLine(v.active, line),
- .focus => |focused| {
- v.window_focused = focused;
- if (focused) if (p.host.vtable.newer_build) |f| if (f(p.host.ctx)) p.setMessage(.at(v.active), newer_build_words);
- },
+ .focus => |focused| v.window_focused = focused,
.handed => |h| p.handover.finish(p, h.seq, h.to, h.failure),
.addon => |a| pardes.Addon.landed(p, a.op, a.pane.index(), a.kind.*),
.job => |j| pardes.Kind.jobDone(p, j.pane.index(), j.serial, j.token, j.gen, j.bytes),
@@ -2945,7 +2943,7 @@ test "a REPL bound for a language takes the exec made on a body in it; tags, Exe
// A body's click written back to event is done as the click: sent. A
// line written to exec came back as F and runs as the command it was.
{
- const th = @import("ninep/testing.zig");
+ const th = @import("ninep/harness.zig");
const event = ctlfs.Node.of(file.serial, .event);
const h = th.call(p, .{ .tag = 1, .op = .open, .node = event }).reply.handle;
defer _ = th.call(p, .{ .tag = 2, .op = .release, .node = event, .handle = h });
@@ -3039,7 +3037,7 @@ test "a REPL bound for a language takes the exec made on a body in it; tags, Exe
try std.testing.expect(Sent.len[1] == 0 and file.prompt == .none);
// The question is in the log, and a script answers it on the ctl.
{
- const th = @import("ninep/testing.zig");
+ const th = @import("ninep/harness.zig");
_ = exec.executeFrom(p, 0, "print(5)", true);
var want: [32]u8 = undefined;
try std.testing.expect(th.logHas(p, try std.fmt.bufPrint(&want, "ask {d} repl a b\n", .{file.serial})));
@@ -3423,7 +3421,7 @@ test "Font keeps requested and acknowledged faces as separate plain state" {
try std.testing.expect(!p.settings.font.pending);
try std.testing.expectEqualStrings(installed[0].name, p.settings.font.effective_name.get());
try std.testing.expectEqual(@as(u16, 1375), p.settings.font.effective_size_hundredths);
- try std.testing.expectEqual(config.Runtime.FontSizeUnit.pixels, p.settings.font.effective_size_unit);
+ try std.testing.expectEqual(config.Settings.FontSizeUnit.pixels, p.settings.font.effective_size_unit);
try std.testing.expect(!p.acknowledgeFont("Duplicate Ack", 1400, .pixels));
try std.testing.expect(p.executeBuiltinLine(p.view().active, cmd));
@@ -3541,7 +3539,7 @@ test "Tab N draws every pane's tab N cells wide and clicks count past it; bare T
try std.testing.expect(p.executeBuiltinLine(0, "Tab 0"));
try std.testing.expectEqual(@as(u16, 8), p.settings.tab);
// The ctl read's tab column, and a Dump's settings.
- const ctl_text = @import("ninep/testing.zig").rd(p, ctlfs.Node.of(pane.serial, .ctl), 0, 4096).bytes;
+ const ctl_text = @import("ninep/harness.zig").rd(p, ctlfs.Node.of(pane.serial, .ctl), 0, 4096).bytes;
try std.testing.expect(std.mem.indexOf(u8, ctl_text, " 8 ") != null);
try dump.dumpState(p);
const restored = try dump.restore(p, p.dump_out.?, "/tmp/pardes.dump.zon");