@@ -787,7 +787,9 @@ object(self)
787
787
(* The height of the displayed material. *)
788
788
789
789
val mutable resolver = None
790
- (* The current resolver for resolving input sequences. *)
790
+ (* The current resolver for resolving input sequences. *)
791
+
792
+ val mutable running = true
791
793
792
794
initializer
793
795
completion_start < - (
@@ -826,7 +828,11 @@ object(self)
826
828
draw_queued < - true ;
827
829
Lwt. pause () >> = fun () ->
828
830
draw_queued < - false ;
829
- Lwt_mutex. with_lock draw_mutex (fun () -> self#draw_update)
831
+ Lwt_mutex. with_lock draw_mutex (fun () ->
832
+ if running then
833
+ self#draw_update
834
+ else
835
+ return () )
830
836
end
831
837
832
838
method draw_update =
@@ -1221,12 +1227,12 @@ object(self)
1221
1227
(* Update the size with the current size. *)
1222
1228
set_size (LTerm. size term);
1223
1229
1224
- let running = ref true in
1230
+ running < - true ;
1225
1231
1226
1232
(* Redraw everything when needed. *)
1227
1233
let event =
1228
1234
E. map_p
1229
- (fun () -> if ! running then self#queue_draw_update else return () )
1235
+ (fun () -> if running then self#queue_draw_update else return () )
1230
1236
(E. select [
1231
1237
E. stamp (S. changes size) () ;
1232
1238
Zed_edit. update self#edit [Zed_edit. cursor self#context];
@@ -1257,7 +1263,7 @@ object(self)
1257
1263
self#queue_draw_update >> = fun () ->
1258
1264
self#loop)
1259
1265
(fun exn ->
1260
- running := false ;
1266
+ running < - false ;
1261
1267
E. stop event;
1262
1268
Lwt_mutex. with_lock draw_mutex (fun () -> self#draw_failure) >> = fun () ->
1263
1269
Lwt. fail exn ))
@@ -1268,7 +1274,7 @@ object(self)
1268
1274
| None ->
1269
1275
return () )
1270
1276
end >> = fun result ->
1271
- running := false ;
1277
+ running < - false ;
1272
1278
E. stop event;
1273
1279
Lwt_mutex. with_lock draw_mutex (fun () -> self#draw_success) >> = fun () ->
1274
1280
return result
0 commit comments