diff --git a/CHANGELOG.md b/CHANGELOG.md index b22b320..81b5eab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v0.9.6 (2025-03-31) +- feat: Added ability to unbound keybinds. +- feat: Added force delete keybind. It's unbound by default. + ## v0.9.5 (2025-03-29) - feat: Added [-v | --version] and [-h | --help] args. diff --git a/PROJECT_BOARD.md b/PROJECT_BOARD.md index b7f32ac..50a6332 100644 --- a/PROJECT_BOARD.md +++ b/PROJECT_BOARD.md @@ -12,7 +12,7 @@ Key: - [ ] Copy files. - [ ] Copy folders. - [ ] Keybind to unzip archives. -- [ ] Keybind to hard delete items (bypass trash). +- [x] Keybind to hard delete items (bypass trash). - [x] Ability to unbind keys. ### Refactors diff --git a/README.md b/README.md index 780e6ef..014345e 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,9 @@ Keybinds = struct { .enter_command_mode: ?Char = ':', .jump_top: ?Char = 'g', .jump_bottom: ?Char = 'G', - .toggle_verbose_file_information: ?Char = 'v' + .toggle_verbose_file_information: ?Char = 'v', + .force_delete: ?Char = null -- Files deleted this way are + not recoverable } NotificationStyles = struct { diff --git a/build.zig b/build.zig index 54f7667..90cfc92 100644 --- a/build.zig +++ b/build.zig @@ -2,7 +2,7 @@ const std = @import("std"); const builtin = @import("builtin"); ///Must match the `version` in `build.zig.zon`. -const version = std.SemanticVersion{ .major = 0, .minor = 9, .patch = 5 }; +const version = std.SemanticVersion{ .major = 0, .minor = 9, .patch = 6 }; const targets: []const std.Target.Query = &.{ .{ .cpu_arch = .aarch64, .os_tag = .macos }, diff --git a/build.zig.zon b/build.zig.zon index 33975b5..c3089e3 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,7 +1,7 @@ .{ .name = .jido, .fingerprint = 0xee45eabe36cafb57, - .version = "0.9.5", + .version = "0.9.6", .minimum_zig_version = "0.14.0", .dependencies = .{ diff --git a/example-config.json b/example-config.json index f206957..692c93c 100644 --- a/example-config.json +++ b/example-config.json @@ -4,7 +4,8 @@ "show_images": true, "preview_file": true, "keybinds": { - "toggle_hidden_files": "h" + "toggle_hidden_files": "h", + "force_delete": null }, "styles": { "selected_list_item": { diff --git a/src/config.zig b/src/config.zig index 07a0eff..adaae7c 100644 --- a/src/config.zig +++ b/src/config.zig @@ -209,6 +209,7 @@ pub const Keybinds = struct { jump_top: ?Char = @enumFromInt('g'), jump_bottom: ?Char = @enumFromInt('G'), toggle_verbose_file_information: ?Char = @enumFromInt('v'), + force_delete: ?Char = null, }; const Styles = struct { diff --git a/src/event_handlers.zig b/src/event_handlers.zig index 1233368..e7739e1 100644 --- a/src/event_handlers.zig +++ b/src/event_handlers.zig @@ -174,11 +174,24 @@ pub fn handleNormalEvent( app.text_input.insertSliceAtCursor(":") catch {}; app.state = .command; }, - .jump_bottom => { - app.directories.entries.selectLast(); - }, + .jump_bottom => app.directories.entries.selectLast(), .jump_top => app.directories.entries.selectFirst(), .toggle_verbose_file_information => app.drawer.verbose = !app.drawer.verbose, + .force_delete => { + const entry = lbl: { + const entry = app.directories.getSelected() catch { + try app.notification.writeErr(.UnableToDelete); + return; + }; + if (entry) |e| break :lbl e else return; + }; + + app.directories.dir.deleteTree(entry.name) catch { + try app.notification.writeErr(.UnableToDelete); + return; + }; + app.directories.removeSelected(); + }, } } else { switch (key.codepoint) {