Compare commits
No commits in common. "5438f19015a8edbbd827538e8ee1ba1ecdf8b2a7" and "c04bbe406244e17b5857f3851fa6a925bbfc9842" have entirely different histories.
5438f19015
...
c04bbe4062
5 changed files with 3 additions and 29 deletions
|
|
@ -45,7 +45,6 @@ indent_mode: IndentMode = .auto,
|
||||||
|
|
||||||
top_bar: []const u8 = "tabs",
|
top_bar: []const u8 = "tabs",
|
||||||
bottom_bar: []const u8 = "mode file log selection diagnostics keybind branch linenumber clock spacer",
|
bottom_bar: []const u8 = "mode file log selection diagnostics keybind branch linenumber clock spacer",
|
||||||
show_bottom_bar_grip: bool = true,
|
|
||||||
show_scrollbars: bool = true,
|
show_scrollbars: bool = true,
|
||||||
show_fileicons: bool = true,
|
show_fileicons: bool = true,
|
||||||
show_local_diagnostics_in_panel: bool = false,
|
show_local_diagnostics_in_panel: bool = false,
|
||||||
|
|
|
||||||
|
|
@ -513,6 +513,7 @@
|
||||||
["alt+v", "system_paste"],
|
["alt+v", "system_paste"],
|
||||||
["alt+n", "goto_next_file"],
|
["alt+n", "goto_next_file"],
|
||||||
["alt+p", "goto_prev_file"],
|
["alt+p", "goto_prev_file"],
|
||||||
|
["shift+enter", "goto_prev_match"],
|
||||||
["shift+f3", "goto_prev_match"],
|
["shift+f3", "goto_prev_match"],
|
||||||
["up", "select_prev_file"],
|
["up", "select_prev_file"],
|
||||||
["down", "select_next_file"],
|
["down", "select_next_file"],
|
||||||
|
|
@ -522,7 +523,6 @@
|
||||||
["f10", "theme_next"],
|
["f10", "theme_next"],
|
||||||
["escape", "mini_mode_cancel"],
|
["escape", "mini_mode_cancel"],
|
||||||
["enter", "mini_mode_select"],
|
["enter", "mini_mode_select"],
|
||||||
["shift+enter", "mini_mode_select_alternate"],
|
|
||||||
["backspace", "mini_mode_delete_backwards"]
|
["backspace", "mini_mode_delete_backwards"]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ view_rows: usize = 0,
|
||||||
view_cols: usize = 0,
|
view_cols: usize = 0,
|
||||||
entries: std.ArrayList(Entry) = undefined,
|
entries: std.ArrayList(Entry) = undefined,
|
||||||
selected: ?usize = null,
|
selected: ?usize = null,
|
||||||
activate: ActivateMode = .normal,
|
|
||||||
box: Widget.Box = .{},
|
box: Widget.Box = .{},
|
||||||
|
|
||||||
const MenuType = Menu.Options(*Self).MenuType;
|
const MenuType = Menu.Options(*Self).MenuType;
|
||||||
|
|
@ -41,11 +40,6 @@ const ButtonType = MenuType.ButtonType;
|
||||||
const path_column_ratio = 4;
|
const path_column_ratio = 4;
|
||||||
const widget_type: Widget.Type = .panel;
|
const widget_type: Widget.Type = .panel;
|
||||||
|
|
||||||
pub const ActivateMode = enum {
|
|
||||||
normal,
|
|
||||||
alternate,
|
|
||||||
};
|
|
||||||
|
|
||||||
const Entry = struct {
|
const Entry = struct {
|
||||||
path: []const u8,
|
path: []const u8,
|
||||||
begin_line: usize,
|
begin_line: usize,
|
||||||
|
|
@ -249,12 +243,7 @@ fn handle_menu_action(menu: **MenuType, button: *ButtonType, _: Widget.Pos) void
|
||||||
self.update_selected();
|
self.update_selected();
|
||||||
const entry = &self.entries.items[idx];
|
const entry = &self.entries.items[idx];
|
||||||
|
|
||||||
const cmd_ = switch (menu.*.opts.ctx.activate) {
|
tp.self_pid().send(.{ "cmd", "navigate", .{
|
||||||
.normal => "navigate",
|
|
||||||
.alternate => "navigate_split_vertical",
|
|
||||||
};
|
|
||||||
|
|
||||||
tp.self_pid().send(.{ "cmd", cmd_, .{
|
|
||||||
.file = entry.path,
|
.file = entry.path,
|
||||||
.goto = .{
|
.goto = .{
|
||||||
entry.end_line + 1,
|
entry.end_line + 1,
|
||||||
|
|
@ -314,11 +303,4 @@ const cmds = struct {
|
||||||
self.menu.activate_selected();
|
self.menu.activate_selected();
|
||||||
}
|
}
|
||||||
pub const goto_selected_file_meta: Meta = .{};
|
pub const goto_selected_file_meta: Meta = .{};
|
||||||
|
|
||||||
pub fn goto_selected_file_alternate(self: *Self, _: Ctx) Result {
|
|
||||||
if (self.menu.selected == null) return tp.exit_error(error.NoSelectedFile, @errorReturnTrace());
|
|
||||||
self.activate = .alternate;
|
|
||||||
self.menu.activate_selected();
|
|
||||||
}
|
|
||||||
pub const goto_selected_file_alternate_meta: Meta = .{};
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -110,8 +110,7 @@ pub fn create(allocator: std.mem.Allocator) CreateError!Widget {
|
||||||
try widgets.add(self.panes_widget);
|
try widgets.add(self.panes_widget);
|
||||||
|
|
||||||
if (tui.config().bottom_bar.len > 0) {
|
if (tui.config().bottom_bar.len > 0) {
|
||||||
const bar_style: @import("status/bar.zig").Style = if (tui.config().show_bottom_bar_grip) .grip else .none;
|
self.bottom_bar = (try widgets.addP(try @import("status/bar.zig").create(allocator, self.plane, tui.config().bottom_bar, .grip, EventHandler.bind(self, handle_bottom_bar_event)))).*;
|
||||||
self.bottom_bar = (try widgets.addP(try @import("status/bar.zig").create(allocator, self.plane, tui.config().bottom_bar, bar_style, EventHandler.bind(self, handle_bottom_bar_event)))).*;
|
|
||||||
}
|
}
|
||||||
if (tp.env.get().is("show-input")) {
|
if (tp.env.get().is("show-input")) {
|
||||||
self.toggle_inputview_async();
|
self.toggle_inputview_async();
|
||||||
|
|
|
||||||
|
|
@ -112,12 +112,6 @@ const cmds = struct {
|
||||||
}
|
}
|
||||||
pub const mini_mode_select_meta: Meta = .{ .description = "Select" };
|
pub const mini_mode_select_meta: Meta = .{ .description = "Select" };
|
||||||
|
|
||||||
pub fn mini_mode_select_alternate(_: *Self, _: Ctx) Result {
|
|
||||||
command.executeName("goto_selected_file_alternate", .{}) catch {};
|
|
||||||
return command.executeName("exit_mini_mode", .{});
|
|
||||||
}
|
|
||||||
pub const mini_mode_select_alternate_meta: Meta = .{ .description = "Select alternate" };
|
|
||||||
|
|
||||||
pub fn mini_mode_insert_code_point(self: *Self, ctx: Ctx) Result {
|
pub fn mini_mode_insert_code_point(self: *Self, ctx: Ctx) Result {
|
||||||
var egc: u32 = 0;
|
var egc: u32 = 0;
|
||||||
if (!try ctx.args.match(.{tp.extract(&egc)}))
|
if (!try ctx.args.match(.{tp.extract(&egc)}))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue