chore(java): async send

This commit is contained in:
zaaarf 2024-08-14 18:51:34 +02:00
parent 24f5bdf2a7
commit fcd2b9f1c9
No known key found for this signature in database
GPG key ID: 102E445F4C3F829B
2 changed files with 4 additions and 4 deletions

View file

@ -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].

View file

@ -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].