feat: add open_version_info command
This commit is contained in:
parent
f9c83ce02a
commit
56e6412837
2 changed files with 11 additions and 1 deletions
|
@ -14,6 +14,8 @@ const c = @cImport({
|
|||
const build_options = @import("build_options");
|
||||
const log = @import("log");
|
||||
|
||||
pub const version_info = @embedFile("version_info");
|
||||
|
||||
pub var max_diff_lines: usize = 50000;
|
||||
pub var max_syntax_lines: usize = 50000;
|
||||
|
||||
|
@ -117,7 +119,7 @@ pub fn main() anyerror!void {
|
|||
};
|
||||
|
||||
if (args.version)
|
||||
return std.io.getStdOut().writeAll(@embedFile("version_info"));
|
||||
return std.io.getStdOut().writeAll(version_info);
|
||||
|
||||
if (args.list_languages) {
|
||||
const stdout = std.io.getStdOut();
|
||||
|
|
|
@ -382,6 +382,14 @@ const cmds = struct {
|
|||
}
|
||||
pub const open_font_test_text_meta = .{ .description = "Open font glyph test text" };
|
||||
|
||||
pub fn open_version_info(self: *Self, _: Ctx) Result {
|
||||
tui.reset_drag_context();
|
||||
try self.create_editor();
|
||||
try command.executeName("open_scratch_buffer", command.fmt(.{ "version", root.version_info, "diff" }));
|
||||
tui.need_render();
|
||||
}
|
||||
pub const open_version_info_meta = .{ .description = "Show build version information" };
|
||||
|
||||
pub fn open_config(_: *Self, _: Ctx) Result {
|
||||
const file_name = try root.get_config_file_name(@import("config"));
|
||||
try tp.self_pid().send(.{ "cmd", "navigate", .{ .file = file_name[0 .. file_name.len - 5] } });
|
||||
|
|
Loading…
Add table
Reference in a new issue