mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 15:24:48 +01:00
fix(java): async content(), moved select_buffer
This commit is contained in:
parent
ab9c6530cd
commit
ada6ed49c1
3 changed files with 5 additions and 4 deletions
4
dist/java/src/mp/code/BufferController.java
vendored
4
dist/java/src/mp/code/BufferController.java
vendored
|
@ -18,8 +18,8 @@ public class BufferController {
|
|||
return get_name(this.ptr);
|
||||
}
|
||||
|
||||
public static native String get_content(long self);
|
||||
public String getContent() {
|
||||
public static native String get_content(long self) throws CodeMPException;
|
||||
public String getContent() throws CodeMPException {
|
||||
return get_content(this.ptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,8 @@ pub extern "system" fn Java_mp_code_BufferController_get_1content(
|
|||
self_ptr: jlong,
|
||||
) -> jstring {
|
||||
let controller = unsafe { Box::leak(Box::from_raw(self_ptr as *mut crate::buffer::Controller)) };
|
||||
let content = controller.content();
|
||||
let content = RT.block_on(controller.content())
|
||||
.jexcept(&mut env);
|
||||
env.new_string(content)
|
||||
.jexcept(&mut env)
|
||||
.as_raw()
|
||||
|
|
|
@ -245,7 +245,7 @@ pub extern "system" fn Java_mp_code_Workspace_select_1buffer(
|
|||
}
|
||||
}
|
||||
|
||||
RT.block_on(crate::buffer::tools::select_buffer(
|
||||
RT.block_on(crate::ext::select_buffer(
|
||||
&controllers,
|
||||
Some(std::time::Duration::from_millis(timeout as u64)),
|
||||
&RT,
|
||||
|
|
Loading…
Reference in a new issue