Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-event/src/redraw.rs')
-rw-r--r--helix-event/src/redraw.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/helix-event/src/redraw.rs b/helix-event/src/redraw.rs
index 8fadb8ae..d1a18899 100644
--- a/helix-event/src/redraw.rs
+++ b/helix-event/src/redraw.rs
@@ -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();
+ }
+}