mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
fix: replace getLast by pop
This commit is contained in:
@ -364,7 +364,7 @@ pub const App = struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Get the last closed tab from the app-level storage
|
// Get the last closed tab from the app-level storage
|
||||||
const last_tab: *LastClosedTab = parent.app.last_closed_tabs.getLast() orelse {
|
const last_tab: LastClosedTab = parent.app.last_closed_tabs.pop() orelse {
|
||||||
log.warn("No last closed tab found", .{});
|
log.warn("No last closed tab found", .{});
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
@ -48,8 +48,10 @@ pub const LastClosedTabs = struct {
|
|||||||
return self.this.len;
|
return self.this.len;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn getLast(self: *LastClosedTabs) ?*LastClosedTab {
|
pub fn pop(self: *LastClosedTabs) ?LastClosedTab {
|
||||||
if (self.this.len == 0) return null;
|
if (self.this.len == 0) return null;
|
||||||
return &self.this.buffer[self.this.len - 1];
|
const last = self.this.buffer[self.this.len - 1];
|
||||||
|
self.this.len -= 1;
|
||||||
|
return last;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user