summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/panes.zig3
-rw-r--r--src/pardes.zig5
2 files changed, 3 insertions, 5 deletions
diff --git a/src/panes.zig b/src/panes.zig
index 356f4913..1e5be107 100644
--- a/src/panes.zig
+++ b/src/panes.zig
@@ -312,8 +312,7 @@ pub const Pane = struct {
/// Close an open prompt, answered or not. Its answer goes with it, and an
/// s/S preview keeps whatever it last previewed.
pub fn closePrompt(pane: *Pane) void {
- if (pane.input.own) |text| pane.gpa.free(text);
- pane.input = .{ .what = .input };
+ pane.input.deinit(pane.gpa);
pane.prompt = .none;
pane.nsel_snap = 0;
}
diff --git a/src/pardes.zig b/src/pardes.zig
index 40e49d6a..b7cf5574 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -4120,10 +4120,9 @@ pub const Pardes = struct {
if (comptime pdf_enabled) if (pane.pdf) |*pv| panes.Pdf.deinitPane(p, pane, pv);
if (pane.file) |*file| panes.File.deinit(p, pane, file);
if (pane.ovl) |o| p.gpa.free(o.text);
- if (pane.input.own) |text| p.gpa.free(text);
+ pane.body.deinit(p.gpa);
pane.tag.deinit(p.gpa);
- for (pane.body.ed_undo[0..pane.body.ed_undo_len]) |sn| if (sn.ovl) |o| p.gpa.free(o.text);
- for (pane.body.ed_redo[0..pane.body.ed_redo_len]) |sn| if (sn.ovl) |o| p.gpa.free(o.text);
+ pane.input.deinit(p.gpa);
panes.Terminal.deinitEmulator(pane, p.gpa);
pane.clearCwd();
pane.fs.deinit(p.gpa);