mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 15:24:48 +01:00
fix(lua): normalize workspace method names
no _buffer
This commit is contained in:
parent
5e95ddde2a
commit
123f11854c
1 changed files with 4 additions and 4 deletions
|
@ -254,19 +254,19 @@ impl LuaUserData for CodempClient {
|
||||||
impl LuaUserData for CodempWorkspace {
|
impl LuaUserData for CodempWorkspace {
|
||||||
fn add_methods<M: LuaUserDataMethods<Self>>(methods: &mut M) {
|
fn add_methods<M: LuaUserDataMethods<Self>>(methods: &mut M) {
|
||||||
methods.add_meta_method(LuaMetaMethod::ToString, |_, this, ()| Ok(format!("{:?}", this)));
|
methods.add_meta_method(LuaMetaMethod::ToString, |_, this, ()| Ok(format!("{:?}", this)));
|
||||||
methods.add_method("create_buffer", |_, this, (name,):(String,)|
|
methods.add_method("create", |_, this, (name,):(String,)|
|
||||||
a_sync! { this => Ok(this.create(&name).await?) }
|
a_sync! { this => Ok(this.create(&name).await?) }
|
||||||
);
|
);
|
||||||
|
|
||||||
methods.add_method("attach_buffer", |_, this, (name,):(String,)|
|
methods.add_method("attach", |_, this, (name,):(String,)|
|
||||||
a_sync! { this => Ok(this.attach(&name).await?) }
|
a_sync! { this => Ok(this.attach(&name).await?) }
|
||||||
);
|
);
|
||||||
|
|
||||||
methods.add_method("detach_buffer", |_, this, (name,):(String,)|
|
methods.add_method("detach", |_, this, (name,):(String,)|
|
||||||
Ok(matches!(this.detach(&name), DetachResult::Detaching | DetachResult::AlreadyDetached))
|
Ok(matches!(this.detach(&name), DetachResult::Detaching | DetachResult::AlreadyDetached))
|
||||||
);
|
);
|
||||||
|
|
||||||
methods.add_method("delete_buffer", |_, this, (name,):(String,)|
|
methods.add_method("delete", |_, this, (name,):(String,)|
|
||||||
a_sync! { this => Ok(this.delete(&name).await?) }
|
a_sync! { this => Ok(this.delete(&name).await?) }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue