refactor: simplify editor "update" event
This commit is contained in:
parent
95e42d2c78
commit
a561de6602
2 changed files with 2 additions and 2 deletions
|
|
@ -1847,7 +1847,7 @@ pub const Editor = struct {
|
|||
}
|
||||
|
||||
fn send_editor_update(self: *const Self, old_root: ?Buffer.Root, new_root: ?Buffer.Root, eol_mode: Buffer.EolMode) !void {
|
||||
_ = try self.handlers.msg(.{ "E", "update", token_from(new_root), token_from(old_root), @intFromEnum(eol_mode) });
|
||||
_ = try self.handlers.msg(.{ "E", "update" });
|
||||
if (self.buffer) |buffer| if (self.syntax) |_| if (self.file_path) |file_path| if (old_root != null and new_root != null)
|
||||
project_manager.did_change(file_path, buffer.lsp_version, try text_from_root(new_root, eol_mode), try text_from_root(old_root, eol_mode), eol_mode) catch {};
|
||||
if (self.buffer) |b| if (b.is_auto_save() and !b.is_ephemeral())
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ fn diff_symbols_clear(self: *Self) void {
|
|||
}
|
||||
|
||||
pub fn handle_event(self: *Self, _: tp.pid_ref, m: tp.message) tp.result {
|
||||
if (try m.match(.{ "E", "update", tp.more }))
|
||||
if (try m.match(.{ "E", "update" }))
|
||||
return self.diff_update() catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
if (try m.match(.{ "E", "view", tp.extract(&self.lines), tp.extract(&self.view_rows), tp.extract(&self.view_top) }))
|
||||
return self.update_width();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue