fix: unicode input in mini modes and palettes

closes: #81
This commit is contained in:
CJ van den Berg 2024-12-17 18:35:47 +01:00
parent e17345eff7
commit ff0987c108
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
8 changed files with 37 additions and 22 deletions

View file

@ -142,7 +142,7 @@ fn load_history(self: *Self, pos: usize) void {
fn update_mini_mode_text(self: *Self) void {
if (tui.current().mini_mode) |*mini_mode| {
mini_mode.text = self.input.items;
mini_mode.cursor = self.input.items.len;
mini_mode.cursor = tui.current().stdplane().egc_chunk_width(self.input.items, 0, 8);
}
}
@ -187,7 +187,7 @@ const cmds = struct {
pub const mini_mode_insert_bytes_meta = .{ .arguments = &.{.string} };
pub fn mini_mode_delete_backwards(self: *Self, _: Ctx) Result {
_ = self.input.popOrNull();
self.input.resize(self.input.items.len - tui.current().stdplane().egc_last(self.input.items).len) catch {};
self.update_mini_mode_text();
}
pub const mini_mode_delete_backwards_meta = .{ .description = "Delete backwards" };