fix: move system_paste command to mainview so it can be used when on editor is open
This commit is contained in:
parent
e69960c6d4
commit
ed843a9baf
2 changed files with 8 additions and 6 deletions
|
@ -2098,12 +2098,6 @@ pub const Editor = struct {
|
|||
}
|
||||
pub const paste_meta = .{ .description = "Paste from internal clipboard" };
|
||||
|
||||
pub fn system_paste(self: *Self, _: Context) Result {
|
||||
if (builtin.os.tag == .windows) return self.paste(.{});
|
||||
tui.current().rdr.request_system_clipboard();
|
||||
}
|
||||
pub const system_paste_meta = .{ .description = "Paste from system clipboard" };
|
||||
|
||||
pub fn delete_forward(self: *Self, _: Context) Result {
|
||||
const b = try self.buf_for_update();
|
||||
const root = try self.delete_to(move_cursor_right, b.root, b.allocator);
|
||||
|
|
|
@ -7,6 +7,7 @@ const root = @import("root");
|
|||
const location_history = @import("location_history");
|
||||
const project_manager = @import("project_manager");
|
||||
const log = @import("log");
|
||||
const builtin = @import("builtin");
|
||||
|
||||
const Plane = @import("renderer").Plane;
|
||||
const input = @import("input");
|
||||
|
@ -543,6 +544,13 @@ const cmds = struct {
|
|||
self.show_file_async_and_free(file_path orelse return error.Stop);
|
||||
}
|
||||
pub const open_previous_file_meta = .{ .description = "Open the previous file" };
|
||||
|
||||
pub fn system_paste(_: *Self, _: Ctx) Result {
|
||||
if (builtin.os.tag == .windows)
|
||||
return command.executeName("paste", .{}) catch {};
|
||||
tui.current().rdr.request_system_clipboard();
|
||||
}
|
||||
pub const system_paste_meta = .{ .description = "Paste from system clipboard" };
|
||||
};
|
||||
|
||||
pub fn handle_editor_event(self: *Self, _: tp.pid_ref, m: tp.message) tp.result {
|
||||
|
|
Loading…
Add table
Reference in a new issue