From 7e7b5684d8f8066b90fca3395104af7241b8aed6 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Fri, 25 Mar 2016 16:46:50 +0100 Subject: Univs: fix get_current_context (bug #4603, part I) Return an evar_map with the right universes, when there are no focused subgoals or the proof is finished. --- stm/lemmas.ml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'stm') diff --git a/stm/lemmas.ml b/stm/lemmas.ml index f06abfcce7..fb64a10c6c 100644 --- a/stm/lemmas.ml +++ b/stm/lemmas.ml @@ -511,5 +511,11 @@ let save_proof ?proof = function let get_current_context () = try Pfedit.get_current_goal_context () with e when Logic.catchable_exception e -> - let env = Global.env () in - (Evd.from_env env, env) + try (* No more focused goals ? *) + let p = Pfedit.get_pftreestate () in + let evd = Proof.in_proof p (fun x -> x) in + (evd, Global.env ()) + with Proof_global.NoCurrentProof -> + let env = Global.env () in + (Evd.from_env env, env) + -- cgit v1.2.3