mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-12-23 22:04:52 +01:00
chore: bindings for TextEdit::apply
This commit is contained in:
parent
592837c664
commit
85079c0330
1 changed files with 2 additions and 1 deletions
|
@ -143,7 +143,7 @@ impl LuaUserData for LuaBufferController {
|
|||
)
|
||||
});
|
||||
methods.add_method("try_recv", |_, this, ()| {
|
||||
match this.0.try_recv() .map_err(LuaCodempError::from)? {
|
||||
match this.0.try_recv().map_err(LuaCodempError::from)? {
|
||||
Some(x) => Ok(Some(LuaTextChange(x))),
|
||||
None => Ok(None),
|
||||
}
|
||||
|
@ -177,6 +177,7 @@ impl LuaUserData for LuaTextChange {
|
|||
}))
|
||||
});
|
||||
methods.add_meta_method(LuaMetaMethod::ToString, |_, this, ()| Ok(format!("{:?}", this.0)));
|
||||
methods.add_method("apply", |_, this, (txt,):(String,)| Ok(this.0.apply(&txt)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue