mirror of
https://github.com/hexedtech/codemp.git
synced 2024-12-23 05:14:54 +01:00
chore(java): async send
This commit is contained in:
parent
24f5bdf2a7
commit
fcd2b9f1c9
2 changed files with 4 additions and 4 deletions
|
@ -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].
|
||||
|
|
|
@ -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].
|
||||
|
|
Loading…
Reference in a new issue