feat(tabs): start work on a tabbar widget
This commit is contained in:
parent
1d947ab499
commit
d7b48b40f1
7 changed files with 196 additions and 2 deletions
|
@ -3786,13 +3786,21 @@ pub const Editor = struct {
|
|||
|
||||
pub fn close_file(self: *Self, _: Context) Result {
|
||||
self.cancel_all_selections();
|
||||
if (self.buffer) |buffer| {
|
||||
if (buffer.is_dirty())
|
||||
return tp.exit("unsaved changes");
|
||||
buffer.hidden = true;
|
||||
}
|
||||
try self.close();
|
||||
}
|
||||
pub const close_file_meta = .{ .description = "Close file" };
|
||||
|
||||
pub fn close_file_without_saving(self: *Self, _: Context) Result {
|
||||
self.cancel_all_selections();
|
||||
if (self.buffer) |buffer| buffer.reset_to_last_saved();
|
||||
if (self.buffer) |buffer| {
|
||||
buffer.reset_to_last_saved();
|
||||
buffer.hidden = true;
|
||||
}
|
||||
try self.close();
|
||||
}
|
||||
pub const close_file_without_saving_meta = .{ .description = "Close file without saving" };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue