diff --git a/src/ffi/java/buffer.rs b/src/ffi/java/buffer.rs index f85c621..0f7b59b 100644 --- a/src/ffi/java/buffer.rs +++ b/src/ffi/java/buffer.rs @@ -98,12 +98,12 @@ pub extern "system" fn Java_mp_code_BufferController_send<'local>( .jexcept(&mut env); let controller = unsafe { Box::leak(Box::from_raw(self_ptr as *mut crate::buffer::Controller)) }; - controller.send(crate::api::TextChange { + RT.block_on(controller.send(crate::api::TextChange { start: start as u32, end: end as u32, content, hash: None - }).jexcept(&mut env); + })).jexcept(&mut env); } /// Called by the Java GC to drop a [crate::buffer::Controller]. diff --git a/src/ffi/java/cursor.rs b/src/ffi/java/cursor.rs index 17baec8..7a43807 100644 --- a/src/ffi/java/cursor.rs +++ b/src/ffi/java/cursor.rs @@ -99,12 +99,12 @@ pub extern "system" fn Java_mp_code_CursorController_send<'local>( }; let controller = unsafe { Box::leak(Box::from_raw(self_ptr as *mut crate::cursor::Controller)) }; - controller.send(crate::api::Cursor { + RT.block_on(controller.send(crate::api::Cursor { start: (start_row, start_col), end: (end_row, end_col), buffer, user - }).jexcept(&mut env); + })).jexcept(&mut env); } /// Called by the Java GC to drop a [crate::cursor::Controller].