build: update to zig 0.14.0-dev.3039
This commit is contained in:
parent
1764b3259c
commit
53045123c6
41 changed files with 648 additions and 623 deletions
|
@ -21,38 +21,39 @@ const Commands = command.Collection(cmds_);
|
|||
const cmds_ = struct {
|
||||
pub const Target = void;
|
||||
const Ctx = command.Context;
|
||||
const Meta = command.Metadata;
|
||||
const Result = command.Result;
|
||||
|
||||
pub fn w(_: *void, _: Ctx) Result {
|
||||
try cmd("save_file", .{});
|
||||
}
|
||||
pub const w_meta = .{ .description = "w (write/save file)" };
|
||||
pub const w_meta: Meta = .{ .description = "w (write/save file)" };
|
||||
|
||||
pub fn q(_: *void, _: Ctx) Result {
|
||||
try cmd("quit", .{});
|
||||
}
|
||||
pub const q_meta = .{ .description = "q (quit)" };
|
||||
pub const q_meta: Meta = .{ .description = "q (quit)" };
|
||||
|
||||
pub fn @"q!"(_: *void, _: Ctx) Result {
|
||||
try cmd("quit_without_saving", .{});
|
||||
}
|
||||
pub const @"q!_meta" = .{ .description = "q! (quit without saving)" };
|
||||
pub const @"q!_meta": Meta = .{ .description = "q! (quit without saving)" };
|
||||
|
||||
pub fn wq(_: *void, _: Ctx) Result {
|
||||
try cmd("save_file", command.fmt(.{ "then", .{ "quit", .{} } }));
|
||||
}
|
||||
pub const wq_meta = .{ .description = "wq (write/save file and quit)" };
|
||||
pub const wq_meta: Meta = .{ .description = "wq (write/save file and quit)" };
|
||||
|
||||
pub fn o(_: *void, _: Ctx) Result {
|
||||
try cmd("open_file", .{});
|
||||
}
|
||||
pub const o_meta = .{ .description = "o (open file)" };
|
||||
pub const o_meta: Meta = .{ .description = "o (open file)" };
|
||||
|
||||
pub fn @"wq!"(_: *void, _: Ctx) Result {
|
||||
cmd("save_file", .{}) catch {};
|
||||
try cmd("quit_without_saving", .{});
|
||||
}
|
||||
pub const @"wq!_meta" = .{ .description = "wq! (write/save file and quit without saving)" };
|
||||
pub const @"wq!_meta": Meta = .{ .description = "wq! (write/save file and quit without saving)" };
|
||||
|
||||
pub fn save_selection(_: *void, _: Ctx) Result {
|
||||
const logger = log.logger("helix-mode");
|
||||
|
@ -65,10 +66,10 @@ const cmds_ = struct {
|
|||
.begin = .{ .row = sel.begin.row, .col = sel.begin.col },
|
||||
.end = .{ .row = sel.end.row, .col = sel.end.col },
|
||||
} else null;
|
||||
mv.location_history.update(file_path, .{
|
||||
mv.location_history_.update(file_path, .{
|
||||
.row = primary.cursor.row + 1,
|
||||
.col = primary.cursor.col + 1,
|
||||
}, sel);
|
||||
}
|
||||
pub const save_selection_meta = .{ .description = "Save current selection to location history" };
|
||||
pub const save_selection_meta: Meta = .{ .description = "Save current selection to location history" };
|
||||
};
|
||||
|
|
|
@ -67,18 +67,19 @@ pub fn Create(options: type) type {
|
|||
const cmds = struct {
|
||||
pub const Target = Self;
|
||||
const Ctx = command.Context;
|
||||
const Meta = command.Metadata;
|
||||
const Result = command.Result;
|
||||
|
||||
pub fn mini_mode_reset(self: *Self, _: Ctx) Result {
|
||||
self.input.clearRetainingCapacity();
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_reset_meta = .{ .description = "Clear input" };
|
||||
pub const mini_mode_reset_meta: Meta = .{ .description = "Clear input" };
|
||||
|
||||
pub fn mini_mode_cancel(_: *Self, _: Ctx) Result {
|
||||
command.executeName("exit_mini_mode", .{}) catch {};
|
||||
}
|
||||
pub const mini_mode_cancel_meta = .{ .description = "Cancel input" };
|
||||
pub const mini_mode_cancel_meta: Meta = .{ .description = "Cancel input" };
|
||||
|
||||
pub fn mini_mode_delete_backwards(self: *Self, _: Ctx) Result {
|
||||
if (self.input.items.len > 0) {
|
||||
|
@ -86,7 +87,7 @@ pub fn Create(options: type) type {
|
|||
}
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_delete_backwards_meta = .{ .description = "Delete backwards" };
|
||||
pub const mini_mode_delete_backwards_meta: Meta = .{ .description = "Delete backwards" };
|
||||
|
||||
pub fn mini_mode_insert_code_point(self: *Self, ctx: Ctx) Result {
|
||||
var egc: u32 = 0;
|
||||
|
@ -97,7 +98,7 @@ pub fn Create(options: type) type {
|
|||
try self.input.appendSlice(buf[0..bytes]);
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_insert_code_point_meta = .{ .arguments = &.{.integer} };
|
||||
pub const mini_mode_insert_code_point_meta: Meta = .{ .arguments = &.{.integer} };
|
||||
|
||||
pub fn mini_mode_insert_bytes(self: *Self, ctx: Ctx) Result {
|
||||
var bytes: []const u8 = undefined;
|
||||
|
@ -106,18 +107,18 @@ pub fn Create(options: type) type {
|
|||
try self.input.appendSlice(bytes);
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_insert_bytes_meta = .{ .arguments = &.{.string} };
|
||||
pub const mini_mode_insert_bytes_meta: Meta = .{ .arguments = &.{.string} };
|
||||
|
||||
pub fn mini_mode_select(self: *Self, _: Ctx) Result {
|
||||
options.select(self);
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_select_meta = .{ .description = "Select" };
|
||||
pub const mini_mode_select_meta: Meta = .{ .description = "Select" };
|
||||
|
||||
pub fn mini_mode_paste(self: *Self, ctx: Ctx) Result {
|
||||
return mini_mode_insert_bytes(self, ctx);
|
||||
}
|
||||
pub const mini_mode_paste_meta = .{ .arguments = &.{.string} };
|
||||
pub const mini_mode_paste_meta: Meta = .{ .arguments = &.{.string} };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -250,6 +250,7 @@ pub fn Create(options: type) type {
|
|||
const cmds = struct {
|
||||
pub const Target = Self;
|
||||
const Ctx = command.Context;
|
||||
const Meta = command.Metadata;
|
||||
const Result = command.Result;
|
||||
|
||||
pub fn mini_mode_reset(self: *Self, _: Ctx) Result {
|
||||
|
@ -257,18 +258,18 @@ pub fn Create(options: type) type {
|
|||
self.file_path.clearRetainingCapacity();
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_reset_meta = .{ .description = "Clear input" };
|
||||
pub const mini_mode_reset_meta: Meta = .{ .description = "Clear input" };
|
||||
|
||||
pub fn mini_mode_cancel(_: *Self, _: Ctx) Result {
|
||||
command.executeName("exit_mini_mode", .{}) catch {};
|
||||
}
|
||||
pub const mini_mode_cancel_meta = .{ .description = "Cancel input" };
|
||||
pub const mini_mode_cancel_meta: Meta = .{ .description = "Cancel input" };
|
||||
|
||||
pub fn mini_mode_delete_to_previous_path_segment(self: *Self, _: Ctx) Result {
|
||||
self.delete_to_previous_path_segment();
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_delete_to_previous_path_segment_meta = .{ .description = "Delete to previous path segment" };
|
||||
pub const mini_mode_delete_to_previous_path_segment_meta: Meta = .{ .description = "Delete to previous path segment" };
|
||||
|
||||
pub fn mini_mode_delete_backwards(self: *Self, _: Ctx) Result {
|
||||
if (self.file_path.items.len > 0) {
|
||||
|
@ -277,25 +278,25 @@ pub fn Create(options: type) type {
|
|||
}
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_delete_backwards_meta = .{ .description = "Delete backwards" };
|
||||
pub const mini_mode_delete_backwards_meta: Meta = .{ .description = "Delete backwards" };
|
||||
|
||||
pub fn mini_mode_try_complete_file(self: *Self, _: Ctx) Result {
|
||||
self.try_complete_file() catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_try_complete_file_meta = .{ .description = "Complete file" };
|
||||
pub const mini_mode_try_complete_file_meta: Meta = .{ .description = "Complete file" };
|
||||
|
||||
pub fn mini_mode_try_complete_file_forward(self: *Self, ctx: Ctx) Result {
|
||||
self.complete_trigger_count = 0;
|
||||
return mini_mode_try_complete_file(self, ctx);
|
||||
}
|
||||
pub const mini_mode_try_complete_file_forward_meta = .{ .description = "Complete file forward" };
|
||||
pub const mini_mode_try_complete_file_forward_meta: Meta = .{ .description = "Complete file forward" };
|
||||
|
||||
pub fn mini_mode_reverse_complete_file(self: *Self, _: Ctx) Result {
|
||||
self.reverse_complete_file() catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_reverse_complete_file_meta = .{ .description = "Reverse complete file" };
|
||||
pub const mini_mode_reverse_complete_file_meta: Meta = .{ .description = "Reverse complete file" };
|
||||
|
||||
pub fn mini_mode_insert_code_point(self: *Self, ctx: Ctx) Result {
|
||||
var egc: u32 = 0;
|
||||
|
@ -307,7 +308,7 @@ pub fn Create(options: type) type {
|
|||
try self.file_path.appendSlice(buf[0..bytes]);
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_insert_code_point_meta = .{ .arguments = &.{.integer} };
|
||||
pub const mini_mode_insert_code_point_meta: Meta = .{ .arguments = &.{.integer} };
|
||||
|
||||
pub fn mini_mode_insert_bytes(self: *Self, ctx: Ctx) Result {
|
||||
var bytes: []const u8 = undefined;
|
||||
|
@ -317,18 +318,18 @@ pub fn Create(options: type) type {
|
|||
try self.file_path.appendSlice(bytes);
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_insert_bytes_meta = .{ .arguments = &.{.string} };
|
||||
pub const mini_mode_insert_bytes_meta: Meta = .{ .arguments = &.{.string} };
|
||||
|
||||
pub fn mini_mode_select(self: *Self, _: Ctx) Result {
|
||||
options.select(self);
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_select_meta = .{ .description = "Select" };
|
||||
pub const mini_mode_select_meta: Meta = .{ .description = "Select" };
|
||||
|
||||
pub fn mini_mode_paste(self: *Self, ctx: Ctx) Result {
|
||||
return mini_mode_insert_bytes(self, ctx);
|
||||
}
|
||||
pub const mini_mode_paste_meta = .{ .arguments = &.{.string} };
|
||||
pub const mini_mode_paste_meta: Meta = .{ .arguments = &.{.string} };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ const name = " find";
|
|||
const Commands = command.Collection(cmds);
|
||||
|
||||
allocator: Allocator,
|
||||
input: ArrayList(u8),
|
||||
input_: ArrayList(u8),
|
||||
last_input: ArrayList(u8),
|
||||
start_view: ed.View,
|
||||
start_cursor: ed.Cursor,
|
||||
|
@ -31,7 +31,7 @@ pub fn create(allocator: Allocator, _: command.Context) !struct { tui.Mode, tui.
|
|||
const self: *Self = try allocator.create(Self);
|
||||
self.* = .{
|
||||
.allocator = allocator,
|
||||
.input = ArrayList(u8).init(allocator),
|
||||
.input_ = ArrayList(u8).init(allocator),
|
||||
.last_input = ArrayList(u8).init(allocator),
|
||||
.start_view = editor.view,
|
||||
.start_cursor = editor.get_primary().cursor,
|
||||
|
@ -41,7 +41,7 @@ pub fn create(allocator: Allocator, _: command.Context) !struct { tui.Mode, tui.
|
|||
if (editor.get_primary().selection) |sel| ret: {
|
||||
const text = editor.get_selection(sel, self.allocator) catch break :ret;
|
||||
defer self.allocator.free(text);
|
||||
try self.input.appendSlice(text);
|
||||
try self.input_.appendSlice(text);
|
||||
}
|
||||
var mode = try keybind.mode("mini/find", allocator, .{
|
||||
.insert_command = "mini_mode_insert_bytes",
|
||||
|
@ -52,7 +52,7 @@ pub fn create(allocator: Allocator, _: command.Context) !struct { tui.Mode, tui.
|
|||
|
||||
pub fn deinit(self: *Self) void {
|
||||
self.commands.deinit();
|
||||
self.input.deinit();
|
||||
self.input_.deinit();
|
||||
self.last_input.deinit();
|
||||
self.allocator.destroy(self);
|
||||
}
|
||||
|
@ -73,24 +73,24 @@ pub fn receive(self: *Self, _: tp.pid_ref, m: tp.message) error{Exit}!bool {
|
|||
fn insert_code_point(self: *Self, c: u32) !void {
|
||||
var buf: [16]u8 = undefined;
|
||||
const bytes = input.ucs32_to_utf8(&[_]u32{c}, &buf) catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
try self.input.appendSlice(buf[0..bytes]);
|
||||
try self.input_.appendSlice(buf[0..bytes]);
|
||||
}
|
||||
|
||||
fn insert_bytes(self: *Self, bytes: []const u8) !void {
|
||||
try self.input.appendSlice(bytes);
|
||||
try self.input_.appendSlice(bytes);
|
||||
}
|
||||
|
||||
fn flush_input(self: *Self) !void {
|
||||
if (self.input.items.len > 0) {
|
||||
if (eql(u8, self.input.items, self.last_input.items))
|
||||
if (self.input_.items.len > 0) {
|
||||
if (eql(u8, self.input_.items, self.last_input.items))
|
||||
return;
|
||||
self.last_input.clearRetainingCapacity();
|
||||
try self.last_input.appendSlice(self.input.items);
|
||||
try self.last_input.appendSlice(self.input_.items);
|
||||
self.editor.find_operation = .goto_next_match;
|
||||
const primary = self.editor.get_primary();
|
||||
primary.selection = null;
|
||||
primary.cursor = self.start_cursor;
|
||||
try self.editor.find_in_buffer(self.input.items);
|
||||
try self.editor.find_in_buffer(self.input_.items);
|
||||
} else {
|
||||
self.editor.get_primary().selection = null;
|
||||
self.editor.init_matches_update();
|
||||
|
@ -114,9 +114,9 @@ fn find_history_prev(self: *Self) void {
|
|||
if (pos > 0) self.history_pos = pos - 1;
|
||||
} else {
|
||||
self.history_pos = history.items.len - 1;
|
||||
if (self.input.items.len > 0)
|
||||
self.editor.push_find_history(self.editor.allocator.dupe(u8, self.input.items) catch return);
|
||||
if (eql(u8, history.items[self.history_pos.?], self.input.items) and self.history_pos.? > 0)
|
||||
if (self.input_.items.len > 0)
|
||||
self.editor.push_find_history(self.editor.allocator.dupe(u8, self.input_.items) catch return);
|
||||
if (eql(u8, history.items[self.history_pos.?], self.input_.items) and self.history_pos.? > 0)
|
||||
self.history_pos = self.history_pos.? - 1;
|
||||
}
|
||||
self.load_history(self.history_pos.?);
|
||||
|
@ -134,39 +134,40 @@ fn find_history_next(self: *Self) void {
|
|||
|
||||
fn load_history(self: *Self, pos: usize) void {
|
||||
if (self.editor.find_history) |*history| {
|
||||
self.input.clearRetainingCapacity();
|
||||
self.input.appendSlice(history.items[pos]) catch {};
|
||||
self.input_.clearRetainingCapacity();
|
||||
self.input_.appendSlice(history.items[pos]) catch {};
|
||||
}
|
||||
}
|
||||
|
||||
fn update_mini_mode_text(self: *Self) void {
|
||||
if (tui.mini_mode()) |mini_mode| {
|
||||
mini_mode.text = self.input.items;
|
||||
mini_mode.cursor = tui.egc_chunk_width(self.input.items, 0, 8);
|
||||
mini_mode.text = self.input_.items;
|
||||
mini_mode.cursor = tui.egc_chunk_width(self.input_.items, 0, 8);
|
||||
}
|
||||
}
|
||||
|
||||
const cmds = struct {
|
||||
pub const Target = Self;
|
||||
const Ctx = command.Context;
|
||||
const Meta = command.Metadata;
|
||||
const Result = command.Result;
|
||||
|
||||
pub fn mini_mode_reset(self: *Self, _: Ctx) Result {
|
||||
self.input.clearRetainingCapacity();
|
||||
self.input_.clearRetainingCapacity();
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_reset_meta = .{ .description = "Clear input" };
|
||||
pub const mini_mode_reset_meta: Meta = .{ .description = "Clear input" };
|
||||
|
||||
pub fn mini_mode_cancel(self: *Self, _: Ctx) Result {
|
||||
self.cancel();
|
||||
}
|
||||
pub const mini_mode_cancel_meta = .{ .description = "Cancel input" };
|
||||
pub const mini_mode_cancel_meta: Meta = .{ .description = "Cancel input" };
|
||||
|
||||
pub fn mini_mode_select(self: *Self, _: Ctx) Result {
|
||||
self.editor.push_find_history(self.input.items);
|
||||
self.editor.push_find_history(self.input_.items);
|
||||
self.cmd("exit_mini_mode", .{}) catch {};
|
||||
}
|
||||
pub const mini_mode_select_meta = .{ .description = "Select" };
|
||||
pub const mini_mode_select_meta: Meta = .{ .description = "Select" };
|
||||
|
||||
pub fn mini_mode_insert_code_point(self: *Self, ctx: Ctx) Result {
|
||||
var egc: u32 = 0;
|
||||
|
@ -175,7 +176,7 @@ const cmds = struct {
|
|||
self.insert_code_point(egc) catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_insert_code_point_meta = .{ .arguments = &.{.integer} };
|
||||
pub const mini_mode_insert_code_point_meta: Meta = .{ .arguments = &.{.integer} };
|
||||
|
||||
pub fn mini_mode_insert_bytes(self: *Self, ctx: Ctx) Result {
|
||||
var bytes: []const u8 = undefined;
|
||||
|
@ -184,28 +185,28 @@ const cmds = struct {
|
|||
self.insert_bytes(bytes) catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_insert_bytes_meta = .{ .arguments = &.{.string} };
|
||||
pub const mini_mode_insert_bytes_meta: Meta = .{ .arguments = &.{.string} };
|
||||
|
||||
pub fn mini_mode_delete_backwards(self: *Self, _: Ctx) Result {
|
||||
self.input.resize(self.input.items.len - tui.egc_last(self.input.items).len) catch {};
|
||||
self.input_.resize(self.input_.items.len - tui.egc_last(self.input_.items).len) catch {};
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_delete_backwards_meta = .{ .description = "Delete backwards" };
|
||||
pub const mini_mode_delete_backwards_meta: Meta = .{ .description = "Delete backwards" };
|
||||
|
||||
pub fn mini_mode_history_prev(self: *Self, _: Ctx) Result {
|
||||
self.find_history_prev();
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_history_prev_meta = .{ .description = "History previous" };
|
||||
pub const mini_mode_history_prev_meta: Meta = .{ .description = "History previous" };
|
||||
|
||||
pub fn mini_mode_history_next(self: *Self, _: Ctx) Result {
|
||||
self.find_history_next();
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_history_next_meta = .{ .description = "History next" };
|
||||
pub const mini_mode_history_next_meta: Meta = .{ .description = "History next" };
|
||||
|
||||
pub fn mini_mode_paste(self: *Self, ctx: Ctx) Result {
|
||||
return mini_mode_insert_bytes(self, ctx);
|
||||
}
|
||||
pub const mini_mode_paste_meta = .{ .arguments = &.{.string} };
|
||||
pub const mini_mode_paste_meta: Meta = .{ .arguments = &.{.string} };
|
||||
};
|
||||
|
|
|
@ -19,7 +19,7 @@ const max_query_size = 1024;
|
|||
|
||||
allocator: Allocator,
|
||||
buf: [max_query_size]u8 = undefined,
|
||||
input: []u8 = "",
|
||||
input_: []u8 = "",
|
||||
last_buf: [max_query_size]u8 = undefined,
|
||||
last_input: []u8 = "",
|
||||
commands: Commands = undefined,
|
||||
|
@ -31,7 +31,7 @@ pub fn create(allocator: Allocator, _: command.Context) !struct { tui.Mode, tui.
|
|||
if (tui.get_active_selection(self.allocator)) |text| {
|
||||
defer self.allocator.free(text);
|
||||
@memcpy(self.buf[0..text.len], text);
|
||||
self.input = self.buf[0..text.len];
|
||||
self.input_ = self.buf[0..text.len];
|
||||
}
|
||||
var mode = try keybind.mode("mini/find_in_files", allocator, .{
|
||||
.insert_command = "mini_mode_insert_bytes",
|
||||
|
@ -59,55 +59,56 @@ pub fn receive(self: *Self, _: tp.pid_ref, m: tp.message) error{Exit}!bool {
|
|||
}
|
||||
|
||||
fn insert_code_point(self: *Self, c: u32) !void {
|
||||
if (self.input.len + 6 >= self.buf.len)
|
||||
if (self.input_.len + 6 >= self.buf.len)
|
||||
return;
|
||||
const bytes = try input.ucs32_to_utf8(&[_]u32{c}, self.buf[self.input.len..]);
|
||||
self.input = self.buf[0 .. self.input.len + bytes];
|
||||
const bytes = try input.ucs32_to_utf8(&[_]u32{c}, self.buf[self.input_.len..]);
|
||||
self.input_ = self.buf[0 .. self.input_.len + bytes];
|
||||
}
|
||||
|
||||
fn insert_bytes(self: *Self, bytes_: []const u8) !void {
|
||||
const bytes = bytes_[0..@min(self.buf.len - self.input.len, bytes_.len)];
|
||||
const newlen = self.input.len + bytes.len;
|
||||
@memcpy(self.buf[self.input.len..newlen], bytes);
|
||||
self.input = self.buf[0..newlen];
|
||||
const bytes = bytes_[0..@min(self.buf.len - self.input_.len, bytes_.len)];
|
||||
const newlen = self.input_.len + bytes.len;
|
||||
@memcpy(self.buf[self.input_.len..newlen], bytes);
|
||||
self.input_ = self.buf[0..newlen];
|
||||
}
|
||||
|
||||
fn start_query(self: *Self) !void {
|
||||
if (self.input.len < 2 or eql(u8, self.input, self.last_input))
|
||||
if (self.input_.len < 2 or eql(u8, self.input_, self.last_input))
|
||||
return;
|
||||
@memcpy(self.last_buf[0..self.input.len], self.input);
|
||||
self.last_input = self.last_buf[0..self.input.len];
|
||||
try command.executeName("find_in_files_query", command.fmt(.{self.input}));
|
||||
@memcpy(self.last_buf[0..self.input_.len], self.input_);
|
||||
self.last_input = self.last_buf[0..self.input_.len];
|
||||
try command.executeName("find_in_files_query", command.fmt(.{self.input_}));
|
||||
}
|
||||
|
||||
fn update_mini_mode_text(self: *Self) void {
|
||||
if (tui.mini_mode()) |mini_mode| {
|
||||
mini_mode.text = self.input;
|
||||
mini_mode.cursor = tui.egc_chunk_width(self.input, 0, 8);
|
||||
mini_mode.text = self.input_;
|
||||
mini_mode.cursor = tui.egc_chunk_width(self.input_, 0, 8);
|
||||
}
|
||||
}
|
||||
|
||||
const cmds = struct {
|
||||
pub const Target = Self;
|
||||
const Ctx = command.Context;
|
||||
const Meta = command.Metadata;
|
||||
const Result = command.Result;
|
||||
|
||||
pub fn mini_mode_reset(self: *Self, _: Ctx) Result {
|
||||
self.input = "";
|
||||
self.input_ = "";
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_reset_meta = .{ .description = "Clear input" };
|
||||
pub const mini_mode_reset_meta: Meta = .{ .description = "Clear input" };
|
||||
|
||||
pub fn mini_mode_cancel(_: *Self, _: Ctx) Result {
|
||||
command.executeName("exit_mini_mode", .{}) catch {};
|
||||
}
|
||||
pub const mini_mode_cancel_meta = .{ .description = "Cancel input" };
|
||||
pub const mini_mode_cancel_meta: Meta = .{ .description = "Cancel input" };
|
||||
|
||||
pub fn mini_mode_select(_: *Self, _: Ctx) Result {
|
||||
command.executeName("goto_selected_file", .{}) catch {};
|
||||
return command.executeName("exit_mini_mode", .{});
|
||||
}
|
||||
pub const mini_mode_select_meta = .{ .description = "Select" };
|
||||
pub const mini_mode_select_meta: Meta = .{ .description = "Select" };
|
||||
|
||||
pub fn mini_mode_insert_code_point(self: *Self, ctx: Ctx) Result {
|
||||
var egc: u32 = 0;
|
||||
|
@ -116,7 +117,7 @@ const cmds = struct {
|
|||
self.insert_code_point(egc) catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_insert_code_point_meta = .{ .arguments = &.{.integer} };
|
||||
pub const mini_mode_insert_code_point_meta: Meta = .{ .arguments = &.{.integer} };
|
||||
|
||||
pub fn mini_mode_insert_bytes(self: *Self, ctx: Ctx) Result {
|
||||
var bytes: []const u8 = undefined;
|
||||
|
@ -125,16 +126,16 @@ const cmds = struct {
|
|||
self.insert_bytes(bytes) catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_insert_bytes_meta = .{ .arguments = &.{.string} };
|
||||
pub const mini_mode_insert_bytes_meta: Meta = .{ .arguments = &.{.string} };
|
||||
|
||||
pub fn mini_mode_delete_backwards(self: *Self, _: Ctx) Result {
|
||||
self.input = self.input[0 .. self.input.len - tui.egc_last(self.input).len];
|
||||
self.input_ = self.input_[0 .. self.input_.len - tui.egc_last(self.input_).len];
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_delete_backwards_meta = .{ .description = "Delete backwards" };
|
||||
pub const mini_mode_delete_backwards_meta: Meta = .{ .description = "Delete backwards" };
|
||||
|
||||
pub fn mini_mode_paste(self: *Self, ctx: Ctx) Result {
|
||||
return mini_mode_insert_bytes(self, ctx);
|
||||
}
|
||||
pub const mini_mode_paste_meta = .{ .arguments = &.{.string} };
|
||||
pub const mini_mode_paste_meta: Meta = .{ .arguments = &.{.string} };
|
||||
};
|
||||
|
|
|
@ -82,13 +82,14 @@ fn insert_bytes(self: *Self, bytes: []const u8) void {
|
|||
const cmds = struct {
|
||||
pub const Target = Self;
|
||||
const Ctx = command.Context;
|
||||
const Meta = command.Metadata;
|
||||
const Result = command.Result;
|
||||
|
||||
pub fn mini_mode_reset(self: *Self, _: Ctx) Result {
|
||||
self.input = null;
|
||||
self.update_mini_mode_text();
|
||||
}
|
||||
pub const mini_mode_reset_meta = .{ .description = "Clear input" };
|
||||
pub const mini_mode_reset_meta: Meta = .{ .description = "Clear input" };
|
||||
|
||||
pub fn mini_mode_cancel(self: *Self, _: Ctx) Result {
|
||||
self.input = null;
|
||||
|
@ -96,7 +97,7 @@ const cmds = struct {
|
|||
self.goto();
|
||||
command.executeName("exit_mini_mode", .{}) catch {};
|
||||
}
|
||||
pub const mini_mode_cancel_meta = .{ .description = "Cancel input" };
|
||||
pub const mini_mode_cancel_meta: Meta = .{ .description = "Cancel input" };
|
||||
|
||||
pub fn mini_mode_delete_backwards(self: *Self, _: Ctx) Result {
|
||||
if (self.input) |linenum| {
|
||||
|
@ -106,7 +107,7 @@ const cmds = struct {
|
|||
self.goto();
|
||||
}
|
||||
}
|
||||
pub const mini_mode_delete_backwards_meta = .{ .description = "Delete backwards" };
|
||||
pub const mini_mode_delete_backwards_meta: Meta = .{ .description = "Delete backwards" };
|
||||
|
||||
pub fn mini_mode_insert_code_point(self: *Self, ctx: Ctx) Result {
|
||||
var keypress: usize = 0;
|
||||
|
@ -119,7 +120,7 @@ const cmds = struct {
|
|||
self.update_mini_mode_text();
|
||||
self.goto();
|
||||
}
|
||||
pub const mini_mode_insert_code_point_meta = .{ .arguments = &.{.integer} };
|
||||
pub const mini_mode_insert_code_point_meta: Meta = .{ .arguments = &.{.integer} };
|
||||
|
||||
pub fn mini_mode_insert_bytes(self: *Self, ctx: Ctx) Result {
|
||||
var bytes: []const u8 = undefined;
|
||||
|
@ -129,5 +130,5 @@ const cmds = struct {
|
|||
self.update_mini_mode_text();
|
||||
self.goto();
|
||||
}
|
||||
pub const mini_mode_insert_bytes_meta = .{ .arguments = &.{.string} };
|
||||
pub const mini_mode_insert_bytes_meta: Meta = .{ .arguments = &.{.string} };
|
||||
};
|
||||
|
|
|
@ -87,6 +87,7 @@ fn execute_operation(self: *Self, ctx: command.Context) command.Result {
|
|||
const cmds = struct {
|
||||
pub const Target = Self;
|
||||
const Ctx = command.Context;
|
||||
const Meta = command.Metadata;
|
||||
const Result = command.Result;
|
||||
|
||||
pub fn mini_mode_insert_code_point(self: *Self, ctx: Ctx) Result {
|
||||
|
@ -97,7 +98,7 @@ const cmds = struct {
|
|||
const bytes = input.ucs32_to_utf8(&[_]u32{code_point}, &buf) catch return error.InvalidMoveToCharCodePoint;
|
||||
return self.execute_operation(command.fmt(.{buf[0..bytes]}));
|
||||
}
|
||||
pub const mini_mode_insert_code_point_meta = .{ .arguments = &.{.integer} };
|
||||
pub const mini_mode_insert_code_point_meta: Meta = .{ .arguments = &.{.integer} };
|
||||
|
||||
pub fn mini_mode_insert_bytes(self: *Self, ctx: Ctx) Result {
|
||||
var bytes: []const u8 = undefined;
|
||||
|
@ -105,10 +106,10 @@ const cmds = struct {
|
|||
return error.InvalidMoveToCharInsertBytesArgument;
|
||||
return self.execute_operation(ctx);
|
||||
}
|
||||
pub const mini_mode_insert_bytes_meta = .{ .arguments = &.{.string} };
|
||||
pub const mini_mode_insert_bytes_meta: Meta = .{ .arguments = &.{.string} };
|
||||
|
||||
pub fn mini_mode_cancel(_: *Self, _: Ctx) Result {
|
||||
command.executeName("exit_mini_mode", .{}) catch {};
|
||||
}
|
||||
pub const mini_mode_cancel_meta = .{ .description = "Cancel input" };
|
||||
pub const mini_mode_cancel_meta: Meta = .{ .description = "Cancel input" };
|
||||
};
|
||||
|
|
|
@ -272,47 +272,48 @@ const Commands = command.Collection(cmds);
|
|||
const cmds = struct {
|
||||
pub const Target = Self;
|
||||
const Ctx = command.Context;
|
||||
const Meta = command.Metadata;
|
||||
const Result = command.Result;
|
||||
|
||||
pub fn palette_menu_top(self: *Self, _: Ctx) Result {
|
||||
self.menu.select_first();
|
||||
}
|
||||
pub const palette_menu_top_meta = .{};
|
||||
pub const palette_menu_top_meta: Meta = .{};
|
||||
|
||||
pub fn palette_menu_down(self: *Self, _: Ctx) Result {
|
||||
self.menu.select_down();
|
||||
}
|
||||
pub const palette_menu_down_meta = .{};
|
||||
pub const palette_menu_down_meta: Meta = .{};
|
||||
|
||||
pub fn palette_menu_up(self: *Self, _: Ctx) Result {
|
||||
self.menu.select_up();
|
||||
}
|
||||
pub const palette_menu_up_meta = .{};
|
||||
pub const palette_menu_up_meta: Meta = .{};
|
||||
|
||||
pub fn palette_menu_activate(self: *Self, _: Ctx) Result {
|
||||
self.menu.activate_selected();
|
||||
}
|
||||
pub const palette_menu_activate_meta = .{};
|
||||
pub const palette_menu_activate_meta: Meta = .{};
|
||||
|
||||
pub fn palette_menu_activate_quick(self: *Self, _: Ctx) Result {
|
||||
if (self.menu.selected orelse 0 > 0) self.menu.activate_selected();
|
||||
}
|
||||
pub const palette_menu_activate_quick_meta = .{};
|
||||
pub const palette_menu_activate_quick_meta: Meta = .{};
|
||||
|
||||
pub fn palette_menu_cancel(self: *Self, _: Ctx) Result {
|
||||
try self.cmd("exit_overlay_mode", .{});
|
||||
}
|
||||
pub const palette_menu_cancel_meta = .{};
|
||||
pub const palette_menu_cancel_meta: Meta = .{};
|
||||
|
||||
pub fn overlay_delete_word_left(self: *Self, _: Ctx) Result {
|
||||
self.delete_word() catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
}
|
||||
pub const overlay_delete_word_left_meta = .{ .description = "Delete word to the left" };
|
||||
pub const overlay_delete_word_left_meta: Meta = .{ .description = "Delete word to the left" };
|
||||
|
||||
pub fn overlay_delete_backwards(self: *Self, _: Ctx) Result {
|
||||
self.delete_code_point() catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
}
|
||||
pub const overlay_delete_backwards_meta = .{ .description = "Delete backwards" };
|
||||
pub const overlay_delete_backwards_meta: Meta = .{ .description = "Delete backwards" };
|
||||
|
||||
pub fn overlay_insert_code_point(self: *Self, ctx: Ctx) Result {
|
||||
var egc: u32 = 0;
|
||||
|
@ -320,7 +321,7 @@ const cmds = struct {
|
|||
return error.InvalidOpenRecentInsertCodePointArgument;
|
||||
self.insert_code_point(egc) catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
}
|
||||
pub const overlay_insert_code_point_meta = .{ .arguments = &.{.integer} };
|
||||
pub const overlay_insert_code_point_meta: Meta = .{ .arguments = &.{.integer} };
|
||||
|
||||
pub fn overlay_insert_bytes(self: *Self, ctx: Ctx) Result {
|
||||
var bytes: []const u8 = undefined;
|
||||
|
@ -328,20 +329,20 @@ const cmds = struct {
|
|||
return error.InvalidOpenRecentInsertBytesArgument;
|
||||
self.insert_bytes(bytes) catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
}
|
||||
pub const overlay_insert_bytes_meta = .{ .arguments = &.{.string} };
|
||||
pub const overlay_insert_bytes_meta: Meta = .{ .arguments = &.{.string} };
|
||||
|
||||
pub fn overlay_toggle_panel(self: *Self, _: Ctx) Result {
|
||||
return self.cmd_async("toggle_panel");
|
||||
}
|
||||
pub const overlay_toggle_panel_meta = .{};
|
||||
pub const overlay_toggle_panel_meta: Meta = .{};
|
||||
|
||||
pub fn overlay_toggle_inputview(self: *Self, _: Ctx) Result {
|
||||
return self.cmd_async("toggle_inputview");
|
||||
}
|
||||
pub const overlay_toggle_inputview_meta = .{};
|
||||
pub const overlay_toggle_inputview_meta: Meta = .{};
|
||||
|
||||
pub fn mini_mode_paste(self: *Self, ctx: Ctx) Result {
|
||||
return overlay_insert_bytes(self, ctx);
|
||||
}
|
||||
pub const mini_mode_paste_meta = .{ .arguments = &.{.string} };
|
||||
pub const mini_mode_paste_meta: Meta = .{ .arguments = &.{.string} };
|
||||
};
|
||||
|
|
|
@ -373,6 +373,7 @@ pub fn Create(options: type) type {
|
|||
const cmds = struct {
|
||||
pub const Target = Self;
|
||||
const Ctx = command.Context;
|
||||
const Meta = command.Metadata;
|
||||
const Result = command.Result;
|
||||
|
||||
pub fn palette_menu_down(self: *Self, _: Ctx) Result {
|
||||
|
@ -390,7 +391,7 @@ pub fn Create(options: type) type {
|
|||
self.menu.select_down();
|
||||
self.selection_updated();
|
||||
}
|
||||
pub const palette_menu_down_meta = .{};
|
||||
pub const palette_menu_down_meta: Meta = .{};
|
||||
|
||||
pub fn palette_menu_up(self: *Self, _: Ctx) Result {
|
||||
if (self.menu.selected) |selected| {
|
||||
|
@ -405,7 +406,7 @@ pub fn Create(options: type) type {
|
|||
self.menu.select_up();
|
||||
self.selection_updated();
|
||||
}
|
||||
pub const palette_menu_up_meta = .{};
|
||||
pub const palette_menu_up_meta: Meta = .{};
|
||||
|
||||
pub fn palette_menu_pagedown(self: *Self, _: Ctx) Result {
|
||||
if (self.total_items > self.view_rows) {
|
||||
|
@ -417,7 +418,7 @@ pub fn Create(options: type) type {
|
|||
self.menu.select_last();
|
||||
self.selection_updated();
|
||||
}
|
||||
pub const palette_menu_pagedown_meta = .{};
|
||||
pub const palette_menu_pagedown_meta: Meta = .{};
|
||||
|
||||
pub fn palette_menu_pageup(self: *Self, _: Ctx) Result {
|
||||
if (self.view_pos > self.view_rows)
|
||||
|
@ -428,7 +429,7 @@ pub fn Create(options: type) type {
|
|||
self.menu.select_first();
|
||||
self.selection_updated();
|
||||
}
|
||||
pub const palette_menu_pageup_meta = .{};
|
||||
pub const palette_menu_pageup_meta: Meta = .{};
|
||||
|
||||
pub fn palette_menu_delete_item(self: *Self, _: Ctx) Result {
|
||||
if (@hasDecl(options, "delete_item")) {
|
||||
|
@ -443,33 +444,33 @@ pub fn Create(options: type) type {
|
|||
}
|
||||
}
|
||||
}
|
||||
pub const palette_menu_delete_item_meta = .{};
|
||||
pub const palette_menu_delete_item_meta: Meta = .{};
|
||||
|
||||
pub fn palette_menu_activate(self: *Self, _: Ctx) Result {
|
||||
self.menu.activate_selected();
|
||||
}
|
||||
pub const palette_menu_activate_meta = .{};
|
||||
pub const palette_menu_activate_meta: Meta = .{};
|
||||
|
||||
pub fn palette_menu_activate_quick(self: *Self, _: Ctx) Result {
|
||||
if (self.menu.selected orelse 0 > 0) self.menu.activate_selected();
|
||||
}
|
||||
pub const palette_menu_activate_quick_meta = .{};
|
||||
pub const palette_menu_activate_quick_meta: Meta = .{};
|
||||
|
||||
pub fn palette_menu_cancel(self: *Self, _: Ctx) Result {
|
||||
if (@hasDecl(options, "cancel")) try options.cancel(self);
|
||||
try self.cmd("exit_overlay_mode", .{});
|
||||
}
|
||||
pub const palette_menu_cancel_meta = .{};
|
||||
pub const palette_menu_cancel_meta: Meta = .{};
|
||||
|
||||
pub fn overlay_delete_word_left(self: *Self, _: Ctx) Result {
|
||||
self.delete_word() catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
}
|
||||
pub const overlay_delete_word_left_meta = .{ .description = "Delete word to the left" };
|
||||
pub const overlay_delete_word_left_meta: Meta = .{ .description = "Delete word to the left" };
|
||||
|
||||
pub fn overlay_delete_backwards(self: *Self, _: Ctx) Result {
|
||||
self.delete_code_point() catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
}
|
||||
pub const overlay_delete_backwards_meta = .{ .description = "Delete backwards" };
|
||||
pub const overlay_delete_backwards_meta: Meta = .{ .description = "Delete backwards" };
|
||||
|
||||
pub fn overlay_insert_code_point(self: *Self, ctx: Ctx) Result {
|
||||
var egc: u32 = 0;
|
||||
|
@ -477,7 +478,7 @@ pub fn Create(options: type) type {
|
|||
return error.InvalidPaletteInsertCodePointArgument;
|
||||
self.insert_code_point(egc) catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
}
|
||||
pub const overlay_insert_code_point_meta = .{ .arguments = &.{.integer} };
|
||||
pub const overlay_insert_code_point_meta: Meta = .{ .arguments = &.{.integer} };
|
||||
|
||||
pub fn overlay_insert_bytes(self: *Self, ctx: Ctx) Result {
|
||||
var bytes: []const u8 = undefined;
|
||||
|
@ -485,22 +486,22 @@ pub fn Create(options: type) type {
|
|||
return error.InvalidPaletteInsertBytesArgument;
|
||||
self.insert_bytes(bytes) catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
}
|
||||
pub const overlay_insert_bytes_meta = .{ .arguments = &.{.string} };
|
||||
pub const overlay_insert_bytes_meta: Meta = .{ .arguments = &.{.string} };
|
||||
|
||||
pub fn overlay_toggle_panel(self: *Self, _: Ctx) Result {
|
||||
return self.cmd_async("toggle_panel");
|
||||
}
|
||||
pub const overlay_toggle_panel_meta = .{};
|
||||
pub const overlay_toggle_panel_meta: Meta = .{};
|
||||
|
||||
pub fn overlay_toggle_inputview(self: *Self, _: Ctx) Result {
|
||||
return self.cmd_async("toggle_inputview");
|
||||
}
|
||||
pub const overlay_toggle_inputview_meta = .{};
|
||||
pub const overlay_toggle_inputview_meta: Meta = .{};
|
||||
|
||||
pub fn mini_mode_paste(self: *Self, ctx: Ctx) Result {
|
||||
return overlay_insert_bytes(self, ctx);
|
||||
}
|
||||
pub const mini_mode_paste_meta = .{ .arguments = &.{.string} };
|
||||
pub const mini_mode_paste_meta: Meta = .{ .arguments = &.{.string} };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -17,33 +17,34 @@ const Commands = command.Collection(cmds_);
|
|||
const cmds_ = struct {
|
||||
pub const Target = void;
|
||||
const Ctx = command.Context;
|
||||
const Meta = command.Metadata;
|
||||
const Result = command.Result;
|
||||
|
||||
pub fn w(_: *void, _: Ctx) Result {
|
||||
try cmd("save_file", .{});
|
||||
}
|
||||
pub const w_meta = .{ .description = "w (write file)" };
|
||||
pub const w_meta: Meta = .{ .description = "w (write file)" };
|
||||
|
||||
pub fn q(_: *void, _: Ctx) Result {
|
||||
try cmd("quit", .{});
|
||||
}
|
||||
pub const q_meta = .{ .description = "q (quit)" };
|
||||
pub const q_meta: Meta = .{ .description = "q (quit)" };
|
||||
|
||||
pub fn @"q!"(_: *void, _: Ctx) Result {
|
||||
try cmd("quit_without_saving", .{});
|
||||
}
|
||||
pub const @"q!_meta" = .{ .description = "q! (quit without saving)" };
|
||||
pub const @"q!_meta": Meta = .{ .description = "q! (quit without saving)" };
|
||||
|
||||
pub fn wq(_: *void, _: Ctx) Result {
|
||||
try cmd("save_file", command.fmt(.{ "then", .{ "quit", .{} } }));
|
||||
}
|
||||
pub const wq_meta = .{ .description = "wq (write file and quit)" };
|
||||
pub const wq_meta: Meta = .{ .description = "wq (write file and quit)" };
|
||||
|
||||
pub fn @"wq!"(_: *void, _: Ctx) Result {
|
||||
cmd("save_file", .{}) catch {};
|
||||
try cmd("quit_without_saving", .{});
|
||||
}
|
||||
pub const @"wq!_meta" = .{ .description = "wq! (write file and quit without saving)" };
|
||||
pub const @"wq!_meta": Meta = .{ .description = "wq! (write file and quit without saving)" };
|
||||
|
||||
pub fn enter_mode_at_next_char(self: *void, ctx: Ctx) Result {
|
||||
_ = self; // autofix
|
||||
|
@ -52,7 +53,7 @@ const cmds_ = struct {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
pub const enter_mode_at_next_char_meta = .{ .description = "Move forward one char and change mode" };
|
||||
pub const enter_mode_at_next_char_meta: Meta = .{ .description = "Move forward one char and change mode" };
|
||||
|
||||
pub fn enter_mode_on_newline_down(self: *void, ctx: Ctx) Result {
|
||||
_ = self; // autofix
|
||||
|
@ -61,7 +62,7 @@ const cmds_ = struct {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
pub const enter_mode_on_newline_down_meta = .{ .description = "Insert a newline and change mode" };
|
||||
pub const enter_mode_on_newline_down_meta: Meta = .{ .description = "Insert a newline and change mode" };
|
||||
|
||||
pub fn enter_mode_on_newline_up(self: *void, ctx: Ctx) Result {
|
||||
_ = self; // autofix
|
||||
|
@ -69,7 +70,7 @@ const cmds_ = struct {
|
|||
//TODO
|
||||
return undefined;
|
||||
}
|
||||
pub const enter_mode_on_newline_up_meta = .{ .description = "Insert a newline above the current line and change mode" };
|
||||
pub const enter_mode_on_newline_up_meta: Meta = .{ .description = "Insert a newline above the current line and change mode" };
|
||||
|
||||
pub fn enter_mode_at_line_begin(self: *void, ctx: Ctx) Result {
|
||||
_ = self; // autofix
|
||||
|
@ -78,7 +79,7 @@ const cmds_ = struct {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
pub const enter_mode_at_line_begin_meta = .{ .description = "Goto line begin and change mode" };
|
||||
pub const enter_mode_at_line_begin_meta: Meta = .{ .description = "Goto line begin and change mode" };
|
||||
|
||||
pub fn enter_mode_at_line_end(self: *void, ctx: Ctx) Result {
|
||||
_ = self; // autofix
|
||||
|
@ -86,7 +87,7 @@ const cmds_ = struct {
|
|||
//TODO
|
||||
return undefined;
|
||||
}
|
||||
pub const enter_mode_at_line_end_meta = .{ .description = "Goto line end and change mode" };
|
||||
pub const enter_mode_at_line_end_meta: Meta = .{ .description = "Goto line end and change mode" };
|
||||
|
||||
pub fn copy_line(self: *void, ctx: Ctx) Result {
|
||||
_ = self; // autofix
|
||||
|
@ -95,7 +96,7 @@ const cmds_ = struct {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
pub const copy_line_meta = .{ .description = "Copies the current line" };
|
||||
pub const copy_line_meta: Meta = .{ .description = "Copies the current line" };
|
||||
|
||||
pub fn delete_line(self: *void, ctx: Ctx) Result {
|
||||
_ = self; // autofix
|
||||
|
@ -110,5 +111,5 @@ const cmds_ = struct {
|
|||
//try self.update_buf(root);
|
||||
//self.clamp();
|
||||
}
|
||||
pub const delete_line_meta = .{ .description = "Delete the current line without copying" };
|
||||
pub const delete_line_meta: Meta = .{ .description = "Delete the current line without copying" };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue