diff --git a/src/api/event.rs b/src/api/event.rs
index 5102a7b..31cfad0 100644
--- a/src/api/event.rs
+++ b/src/api/event.rs
@@ -13,8 +13,7 @@ impl From<&WorkspaceEventInner> for Event {
WorkspaceEventInner::Leave(e) => Self::UserLeave(e.user.id.clone()),
WorkspaceEventInner::Create(_)
| WorkspaceEventInner::Rename(_)
- | WorkspaceEventInner::Delete(_)
- => Self::FileTreeUpdated,
+ | WorkspaceEventInner::Delete(_) => Self::FileTreeUpdated,
}
}
}
diff --git a/src/ffi/python/controllers.rs b/src/ffi/python/controllers.rs
index e7b8537..68d5e1e 100644
--- a/src/ffi/python/controllers.rs
+++ b/src/ffi/python/controllers.rs
@@ -4,37 +4,44 @@ use crate::api::TextChange;
use crate::buffer::Controller as BufferController;
use crate::cursor::Controller as CursorController;
use pyo3::prelude::*;
-use pyo3::types::PyType;
+use pyo3_asyncio::tokio::future_into_py;
// use super::CodempController;
#[pymethods]
impl CursorController {
#[pyo3(name = "send")]
- pub fn pysend(&self, path: String, start: (i32, i32), end: (i32, i32)) -> PyResult<()> {
+ pub fn pysend<'p>(
+ &self,
+ py: Python<'p>,
+ path: String,
+ start: (i32, i32),
+ end: (i32, i32),
+ ) -> PyResult<&'p PyAny> {
+ let rc = self.clone();
let pos = Cursor {
start,
end,
buffer: path,
user: None,
};
-
- Ok(self.send(pos)?)
+ let rc = self.clone();
+ future_into_py(py, async move { Ok(rc.send(pos).await?) })
}
#[pyo3(name = "try_recv")]
- pub fn pytry_recv(&self, py: Python<'_>) -> PyResult