╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────╮ │1 const std = @import("std"); │ │2 const ui = @import("../../ui.zig"); │ │3 +const inp = @import("../input.zig");│ │4 const xit = @import("xit"); │ │5 const xitui = xit.xitui; │ │6 const wgt = xitui.widget; │ ╰───────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │155 pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void {│ │156 _ = allocator; │ │157 const current_tab = self.currentTabIndex() orelse return; │ │157 - var new_tab = current_tab; │ │158 - switch (key) { │ │159 - .arrow_left => new_tab -|= 1, │ │160 - .arrow_right => if (new_tab + 1 < self.tab_ids.count()) { │ │161 - new_tab += 1; │ │162 - }, │ │163 - else => {}, │ │164 - } │ │165 - if (new_tab != current_tab) { │ │158 + if (inp.moveTab(key, current_tab, self.tab_ids.count())) |new_tab| { │ │159 root_focus.setFocus(self.tab_ids.keys()[new_tab]); │ │160 } │ │161 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯