mirror of
https://github.com/helix-editor/helix.git
synced 2025-10-06 00:13:28 +02:00
Request a UI redraw on Drop of an Injector
This fixes the changed files picker when used against a clean worktree for example. Without it the running indicator does not disappear. It also simplifies the dynamic query handler's implementation so that it doesn't need to request a redraw explicitly. Co-authored-by: Pascal Kuthe <pascalkuthe@pm.me>
This commit is contained in:
@@ -34,7 +34,9 @@
|
||||
use anyhow::Result;
|
||||
pub use cancel::{cancelable_future, cancelation, CancelRx, CancelTx};
|
||||
pub use debounce::{send_blocking, AsyncHook};
|
||||
pub use redraw::{lock_frame, redraw_requested, request_redraw, start_frame, RenderLockGuard};
|
||||
pub use redraw::{
|
||||
lock_frame, redraw_requested, request_redraw, start_frame, RenderLockGuard, RequestRedrawOnDrop,
|
||||
};
|
||||
pub use registry::Event;
|
||||
|
||||
mod cancel;
|
||||
|
@@ -51,3 +51,12 @@ pub fn start_frame() {
|
||||
pub fn lock_frame() -> RenderLockGuard {
|
||||
RENDER_LOCK.read()
|
||||
}
|
||||
|
||||
/// A zero sized type that requests a redraw via [request_redraw] when the type [Drop]s.
|
||||
pub struct RequestRedrawOnDrop;
|
||||
|
||||
impl Drop for RequestRedrawOnDrop {
|
||||
fn drop(&mut self) {
|
||||
request_redraw();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user