fix: close existing editor if there is one is save_as
This commit is contained in:
parent
9e4d4a00e1
commit
195ba1e385
1 changed files with 2 additions and 0 deletions
|
|
@ -827,6 +827,8 @@ const cmds = struct {
|
||||||
if (new_buffer.is_dirty())
|
if (new_buffer.is_dirty())
|
||||||
return tp.exit("save as would overwrite unsaved changes");
|
return tp.exit("save as would overwrite unsaved changes");
|
||||||
existing = true;
|
existing = true;
|
||||||
|
if (self.get_editor_for_buffer(new_buffer)) |other_editor|
|
||||||
|
other_editor.close_editor() catch {};
|
||||||
}
|
}
|
||||||
try self.create_editor();
|
try self.create_editor();
|
||||||
try command.executeName("open_scratch_buffer", command.fmt(.{
|
try command.executeName("open_scratch_buffer", command.fmt(.{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue