From 115e629ec14757430462ce4d0ba8e8bd4e193fab Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Thu, 13 Jul 2023 17:42:40 -0700 Subject: [PATCH] fix pane:split{} Similar issue as 31eb4fe27196c1dd993c569941f106db56af3016 refs: https://github.com/wez/wezterm/issues/3985 --- lua-api-crates/mux/src/pane.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lua-api-crates/mux/src/pane.rs b/lua-api-crates/mux/src/pane.rs index 469519da7..60be9790d 100644 --- a/lua-api-crates/mux/src/pane.rs +++ b/lua-api-crates/mux/src/pane.rs @@ -1,6 +1,6 @@ use super::*; use luahelper::{dynamic_to_lua_value, from_lua, to_lua}; -use mlua::{UserDataRef, Value}; +use mlua::Value; use std::cmp::Ordering; use std::sync::Arc; use termwiz::cell::SemanticType; @@ -89,15 +89,9 @@ impl UserData for MuxPane { }); methods.add_method("pane_id", |_, this, _: ()| Ok(this.0)); - methods.add_async_method( - "split", - |_, this, args: Option>| async move { - match args { - Some(args) => args.run(this).await, - None => SplitPane::default().run(this).await, - } - }, - ); + methods.add_async_method("split", |_, this, args: Option| async move { + args.unwrap_or_default().run(this).await + }); methods.add_method("send_paste", |_, this, text: String| { let mux = get_mux()?;