fix: destroy editor before creating a new one
Editor lifetimes should not overlap otherwise we run into duplicate command issues.
This commit is contained in:
parent
3d5119c335
commit
a404f6e768
1 changed files with 1 additions and 0 deletions
|
@ -333,6 +333,7 @@ pub fn walk(self: *Self, ctx: *anyopaque, f: Widget.WalkFn, w: *Widget) bool {
|
|||
}
|
||||
|
||||
fn create_editor(self: *Self) tp.result {
|
||||
self.widgets.replace(0, Widget.empty(self.a, self.plane, .dynamic) catch |e| return tp.exit_error(e));
|
||||
command.executeName("enter_mode_default", .{}) catch {};
|
||||
var editor_widget = ed.create(self.a, Widget.to(self)) catch |e| return tp.exit_error(e);
|
||||
errdefer editor_widget.deinit(self.a);
|
||||
|
|
Loading…
Add table
Reference in a new issue