fix: close existing editor if there is one is save_as

This commit is contained in:
CJ van den Berg 2026-02-06 12:56:34 +01:00
parent 9e4d4a00e1
commit 195ba1e385
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -827,6 +827,8 @@ const cmds = struct {
if (new_buffer.is_dirty())
return tp.exit("save as would overwrite unsaved changes");
existing = true;
if (self.get_editor_for_buffer(new_buffer)) |other_editor|
other_editor.close_editor() catch {};
}
try self.create_editor();
try command.executeName("open_scratch_buffer", command.fmt(.{