feat: save file if changed if auto save is enabled

This commit is contained in:
CJ van den Berg 2025-07-16 17:22:06 +02:00
parent 35e36089a8
commit 99664742c3
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -1693,6 +1693,8 @@ pub const Editor = struct {
_ = try self.handlers.msg(.{ "E", "update", token_from(new_root), token_from(old_root), @intFromEnum(eol_mode) });
if (self.syntax) |_| if (self.file_path) |file_path| if (old_root != null and new_root != null)
project_manager.did_change(file_path, self.lsp_version, try text_from_root(new_root, eol_mode), try text_from_root(old_root, eol_mode), eol_mode) catch {};
if (self.enable_auto_save)
tp.self_pid().send(.{ "cmd", "save_file", .{} }) catch {};
}
fn send_editor_eol_mode(self: *const Self, eol_mode: Buffer.EolMode, utf8_sanitized: bool) !void {