diff --git a/src/tui/mainview.zig b/src/tui/mainview.zig index b8fc38b..1243632 100644 --- a/src/tui/mainview.zig +++ b/src/tui/mainview.zig @@ -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"); diff --git a/src/tui/mode/vim.zig b/src/tui/mode/vim.zig index 81839b9..e88cd7d 100644 --- a/src/tui/mode/vim.zig +++ b/src/tui/mode/vim.zig @@ -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}))