diff options
| author | Arnaud Spiwack | 2015-03-03 12:01:34 +0100 |
|---|---|---|
| committer | Arnaud Spiwack | 2015-03-13 16:41:03 +0100 |
| commit | 2837753608c077b543467ad086d393dddf9c3f9d (patch) | |
| tree | 36cccdd396ac930be352cdc39194071cf60a9791 /plugins/decl_mode/decl_mode.ml | |
| parent | 46957a5114fbc955f7c48d73cb0e02e932ddd520 (diff) | |
Declarative mode: fix the focus behaviour.
I had previously mistakenly enforced the property that after solving every goal in a block, unfocusing was performed automatically until one goal is in focus. This is not how the declarative mode is supposed to behave. Rather every focus must be explicitely unfocused by a closing command.
This hit a few bad interaction with the pure representation of proof introduced for the asynchronous processing.
Some of the invariants seem fragile, so this minimally disruptive solution is probably not long-term. In particular since each block uses the same focus kind, an `end <block>` may close another block than intended if the number of unfocussing command executed is not the right one.
Diffstat (limited to 'plugins/decl_mode/decl_mode.ml')
| -rw-r--r-- | plugins/decl_mode/decl_mode.ml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/decl_mode/decl_mode.ml b/plugins/decl_mode/decl_mode.ml index d169dc1372..07bf6d3268 100644 --- a/plugins/decl_mode/decl_mode.ml +++ b/plugins/decl_mode/decl_mode.ml @@ -89,7 +89,7 @@ let get_info sigma gl= let try_get_info sigma gl = Store.get (Goal.V82.extra sigma gl) info -let get_stack pts = +let get_goal_stack pts = let { it = goals ; sigma = sigma } = Proof.V82.subgoals pts in let info = get_info sigma (List.hd goals) in info.pm_stack @@ -99,7 +99,7 @@ let proof_focus = Proof.new_focus_kind () let proof_cond = Proof.no_cond proof_focus let focus p = - let inf = get_stack p in + let inf = get_goal_stack p in Proof_global.simple_with_current_proof (fun _ -> Proof.focus proof_cond inf 1) let unfocus () = @@ -116,6 +116,8 @@ let get_top_stack pts = let info = get_info sigma gl in info.pm_stack +let get_stack pts = Proof.get_at_focus proof_focus pts + let get_last env = match Environ.named_context env with | (id,_,_)::_ -> id | [] -> error "no previous statement to use" |
