feat: add status message on input mode change
This commit is contained in:
parent
daaa524088
commit
9537c54962
6 changed files with 8 additions and 0 deletions
|
@ -30,6 +30,7 @@ pub fn create(a: Allocator) !tui.Mode {
|
|||
return .{
|
||||
.handler = EventHandler.to_owned(self),
|
||||
.name = root.application_logo ++ root.application_name,
|
||||
.description = "default",
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ pub fn create(a: std.mem.Allocator) !tui.Mode {
|
|||
return .{
|
||||
.handler = EventHandler.to_owned(self),
|
||||
.name = root.application_logo ++ root.application_name,
|
||||
.description = "home",
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ pub fn create(a: Allocator) !tui.Mode {
|
|||
return .{
|
||||
.handler = EventHandler.to_owned(self),
|
||||
.name = root.application_logo ++ "INSERT",
|
||||
.description = "vim",
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ pub fn create(a: Allocator) !tui.Mode {
|
|||
return .{
|
||||
.handler = EventHandler.to_owned(self),
|
||||
.name = root.application_logo ++ "NORMAL",
|
||||
.description = "vim",
|
||||
.line_numbers = .relative,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ pub fn create(a: Allocator) !tui.Mode {
|
|||
return .{
|
||||
.handler = EventHandler.to_owned(self),
|
||||
.name = root.application_logo ++ "VISUAL",
|
||||
.description = "vim",
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -703,6 +703,7 @@ const cmds = struct {
|
|||
self.logger.print("unknown mode {s}", .{mode});
|
||||
break :ret @import("mode/input/flow.zig").create(self.a) catch |e| return tp.exit_error(e);
|
||||
};
|
||||
self.logger.print("input mode: {s}", .{(self.input_mode orelse return).description});
|
||||
}
|
||||
|
||||
pub fn enter_mode_default(self: *Self, _: Ctx) tp.result {
|
||||
|
@ -742,6 +743,7 @@ const cmds = struct {
|
|||
self.input_mode = .{
|
||||
.handler = mode_instance.handler(),
|
||||
.name = mode_instance.name(),
|
||||
.description = mode_instance.name(),
|
||||
};
|
||||
self.mini_mode = .{};
|
||||
}
|
||||
|
@ -759,6 +761,7 @@ const cmds = struct {
|
|||
pub const Mode = struct {
|
||||
handler: EventHandler,
|
||||
name: []const u8,
|
||||
description: []const u8,
|
||||
line_numbers: enum { absolute, relative } = .absolute,
|
||||
|
||||
fn deinit(self: *Mode) void {
|
||||
|
|
Loading…
Add table
Reference in a new issue