feat: make b key in goto mini mode toggle goto byte offset mode
This commit is contained in:
parent
477e232f19
commit
f0e2ef442f
2 changed files with 12 additions and 1 deletions
|
|
@ -428,7 +428,7 @@
|
||||||
},
|
},
|
||||||
"mini/numeric": {
|
"mini/numeric": {
|
||||||
"press": [
|
"press": [
|
||||||
["b", "goto_offset"],
|
["b", "toggle_goto_style"],
|
||||||
["ctrl+q", "quit"],
|
["ctrl+q", "quit"],
|
||||||
["ctrl+v", "system_paste"],
|
["ctrl+v", "system_paste"],
|
||||||
["ctrl+u", "mini_mode_reset"],
|
["ctrl+u", "mini_mode_reset"],
|
||||||
|
|
|
||||||
|
|
@ -1185,6 +1185,17 @@ const cmds = struct {
|
||||||
.arguments = &.{.integer},
|
.arguments = &.{.integer},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub fn toggle_goto_style(self: *Self, ctx: Ctx) Result {
|
||||||
|
return if (self.mini_mode_) |mode|
|
||||||
|
if (std.mem.eql(u8, mode.name, "#goto byte"))
|
||||||
|
command.executeName("goto", ctx)
|
||||||
|
else
|
||||||
|
command.executeName("goto_offset", ctx)
|
||||||
|
else
|
||||||
|
command.executeName("goto", ctx);
|
||||||
|
}
|
||||||
|
pub const toggle_goto_style_meta: Meta = .{ .description = "Toggle goto byte offset mode" };
|
||||||
|
|
||||||
pub fn move_to_char(self: *Self, ctx: Ctx) Result {
|
pub fn move_to_char(self: *Self, ctx: Ctx) Result {
|
||||||
return enter_mini_mode(self, @import("mode/mini/move_to_char.zig"), ctx);
|
return enter_mini_mode(self, @import("mode/mini/move_to_char.zig"), ctx);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue