File tree 3 files changed +8
-4
lines changed
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,9 @@ module AttributeActions = struct
53
53
let unfocus window elem =
54
54
let action _elem =
55
55
let > coord = State.Focus. pop () in
56
- Window. move window coord ~delay: 1.0
56
+ match coord with
57
+ | None -> UndoMonad. return ()
58
+ | Some coord -> Window. move window coord ~delay: 1.0
57
59
in
58
60
act_on_elem " unfocus-at-unpause" action elem
59
61
Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ module Focus = struct
25
25
UndoMonad. return ~undo (Stack. push c stack)
26
26
27
27
let pop () =
28
- let value = Stack. pop stack in
29
- let undo () = Fut. return @@ Stack. push value stack in
28
+ let value = Stack. pop_opt stack in
29
+ let undo () =
30
+ Fut. return @@ Option. iter (fun v -> Stack. push v stack) value
31
+ in
30
32
UndoMonad. return ~undo value
31
33
end
Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ val incr_step : unit -> unit UndoMonad.t
5
5
6
6
module Focus : sig
7
7
val push : Coordinates .window -> unit UndoMonad .t
8
- val pop : unit -> Coordinates .window UndoMonad .t
8
+ val pop : unit -> Coordinates .window option UndoMonad .t
9
9
end
You can’t perform that action at this time.
0 commit comments