method advance ?statement () =
try
- self#_advance ?statement ()
+ self#_advance ?statement ();
+ self#notify
with Margin -> ()
- method retract () = try self#_retract () with Margin -> ()
+ method retract () =
+ try
+ self#_retract ();
+ self#notify
+ with Margin -> ()
method private getFuture =
buffer#get_text ~start:(buffer#get_iter_at_mark (`MARK locked_mark))
buffer#move_mark mark ~where:new_mark_pos;
buffer#apply_tag locked_tag ~start:buffer#start_iter ~stop:new_mark_pos;
buffer#move_mark `INSERT old_insert;
- self#notify
+ match self#status.proof_status with
+ Incomplete_proof (_,goal) -> self#setGoal goal
+ | _ -> ()
val mutable observers = []
statements <- [];
history <- [ init ];
userGoal <- ~-1;
- self#notify;
buffer#remove_tag locked_tag ~start:buffer#start_iter ~stop:buffer#end_iter;
buffer#move_mark (`MARK locked_mark) ~where:buffer#start_iter
method reset () =
self#goto_top;
- buffer#delete ~start:buffer#start_iter ~stop:buffer#end_iter
+ buffer#delete ~start:buffer#start_iter ~stop:buffer#end_iter;
+ self#notify
method goto (pos: [`Top | `Bottom | `Cursor]) () =
match pos with
- | `Top -> self#goto_top
+ | `Top -> self#goto_top; self#notify
| `Bottom ->
- (try while true do self#_advance () done with Margin -> ())
+ (try while true do self#_advance () done; self#notify with Margin -> ())
| `Cursor ->
let locked_iter () = buffer#get_iter_at_mark (`NAME "locked") in
let cursor_iter () = buffer#get_iter_at_mark `INSERT in
let cmp = (locked_iter ())#compare (cursor_iter ()) in
(try
if cmp < 0 then (* locked < cursor *)
- forward_until_cursor ()
+ (forward_until_cursor (); self#notify)
else if cmp > 0 then (* locked > cursor *)
- back_until_cursor ()
+ (back_until_cursor (); self#notify)
else (* cursor = locked *)
()
with Margin -> ())