feat: use current file name as default for save as
This commit is contained in:
parent
e79f10d59f
commit
2d67d4a2c6
1 changed files with 1 additions and 3 deletions
|
@ -21,9 +21,7 @@ pub const create = Type.create;
|
|||
|
||||
pub fn load_entries(self: *Type) !void {
|
||||
if (tui.current().mainview.dynamic_cast(mainview)) |mv_| if (mv_.get_editor()) |editor| {
|
||||
if (editor.file_path) |old_path|
|
||||
if (std.mem.lastIndexOf(u8, old_path, "/")) |pos|
|
||||
try self.file_path.appendSlice(old_path[0 .. pos + 1]);
|
||||
try self.file_path.appendSlice(editor.file_path orelse "");
|
||||
if (editor.get_primary().selection) |sel| ret: {
|
||||
const text = editor.get_selection(sel, self.a) catch break :ret;
|
||||
defer self.a.free(text);
|
||||
|
|
Loading…
Add table
Reference in a new issue