Compare commits
No commits in common. "f7496654ae3982fb39e766d87eec90d03a99525a" and "024eb8b43b824f3faf97930c3a48c06a5d8cf909" have entirely different histories.
f7496654ae
...
024eb8b43b
2 changed files with 2 additions and 29 deletions
|
|
@ -617,10 +617,8 @@ const cmds = struct {
|
|||
|
||||
pub fn delete_buffer(self: *Self, ctx: Ctx) Result {
|
||||
var file_path: []const u8 = undefined;
|
||||
if (!(ctx.args.match(.{tp.extract(&file_path)}) catch false)) {
|
||||
const editor = self.get_active_editor() orelse return error.InvalidDeleteBufferArgument;
|
||||
file_path = editor.file_path orelse return error.InvalidDeleteBufferArgument;
|
||||
}
|
||||
if (!(ctx.args.match(.{tp.extract(&file_path)}) catch false))
|
||||
return error.InvalidDeleteBufferArgument;
|
||||
const buffer = self.buffer_manager.get_buffer_for_file(file_path) orelse return;
|
||||
if (buffer.is_dirty())
|
||||
return tp.exit("unsaved changes");
|
||||
|
|
|
|||
|
|
@ -51,31 +51,6 @@ const cmds_ = struct {
|
|||
}
|
||||
pub const @"e!_meta": Meta = .{ .description = "e! (force reload current file)" };
|
||||
|
||||
pub fn bd(_: *void, _: Ctx) Result {
|
||||
try cmd("close_file", .{});
|
||||
}
|
||||
pub const bd_meta: Meta = .{ .description = "bd (Close file)" };
|
||||
|
||||
pub fn bw(_: *void, _: Ctx) Result {
|
||||
try cmd("delete_buffer", .{});
|
||||
}
|
||||
pub const bw_meta: Meta = .{ .description = "bw (Delete buffer)" };
|
||||
|
||||
pub fn bnext(_: *void, _: Ctx) Result {
|
||||
try cmd("next_tab", .{});
|
||||
}
|
||||
pub const bnext_meta: Meta = .{ .description = "bnext (Next buffer/tab)" };
|
||||
|
||||
pub fn bprevious(_: *void, _: Ctx) Result {
|
||||
try cmd("next_tab", .{});
|
||||
}
|
||||
pub const bprevious_meta: Meta = .{ .description = "bprevious (Previous buffer/tab)" };
|
||||
|
||||
pub fn ls(_: *void, _: Ctx) Result {
|
||||
try cmd("switch_buffers", .{});
|
||||
}
|
||||
pub const ls_meta: Meta = .{ .description = "ls (List/switch buffers)" };
|
||||
|
||||
pub fn move_begin_or_add_integer_argument_zero(_: *void, _: Ctx) Result {
|
||||
return if (@import("keybind").current_integer_argument()) |_|
|
||||
command.executeName("add_integer_argument_digit", command.fmt(.{0}))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue