X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2FmatitaMathView.ml;h=f00ea1a0fe89be0f6859ce7d91141579f5314534;hb=2b649ad5e3d7413b795fe86bdf7fe6a5c0b9c194;hp=ade02fb8087cb377f604810c9f805f4d6cb827f5;hpb=11b2157bacf59cfc561c2ef6f92ee41ee2c1a006;p=helm.git diff --git a/helm/software/matita/matitaMathView.ml b/helm/software/matita/matitaMathView.ml index ade02fb80..f00ea1a0f 100644 --- a/helm/software/matita/matitaMathView.ml +++ b/helm/software/matita/matitaMathView.ml @@ -798,9 +798,9 @@ class sequentsViewer ~(notebook:GPack.notebook) ~(cicMathView:cicMathView) () = self#script#setGoal (Some (goal_of_switch goal_switch)); self#render_page ~page ~goal_switch)) - method nload_sequents - { NTacStatus.istatus = { NTacStatus.pstatus = (_,_,metasenv,subst,_) }; gstatus = stack } - = + method nload_sequents : 'status. #NTacStatus.tac_status as 'status -> unit + = fun status -> + let _,_,metasenv,subst,_ = status#obj in _metasenv <- `New (metasenv,subst); pages <- 0; let win goal_switch = @@ -825,7 +825,7 @@ class sequentsViewer ~(notebook:GPack.notebook) ~(cicMathView:cicMathView) () = w#coerce in assert ( - let stack_goals = Stack.open_goals stack in + let stack_goals = Stack.open_goals status#stack in let proof_goals = List.map fst metasenv in if HExtlib.list_uniq (List.sort Pervasives.compare stack_goals) @@ -863,13 +863,13 @@ class sequentsViewer ~(notebook:GPack.notebook) ~(cicMathView:cicMathView) () = match depth, pos with | 0, 0 -> `Current (render_switch sw) | 0, _ -> `Shift (pos, `Current (render_switch sw)) - | 1, pos when Stack.head_tag stack = `BranchTag -> + | 1, pos when Stack.head_tag status#stack = `BranchTag -> `Shift (pos, render_switch sw) | _ -> render_switch sw in add_tab markup sw) ~cont:add_switch ~todo:add_switch - stack; + status#stack; switch_page_callback <- Some (notebook#connect#switch_page ~callback:(fun page -> let goal_switch = @@ -1335,16 +1335,23 @@ class cicBrowser_impl ~(history:MatitaTypes.mathViewer_entry MatitaMisc.history) method private home () = self#_showMath; - match self#script#grafite_status.proof_status with + match self#script#grafite_status#proof_status with | Proof (uri, metasenv, _subst, bo, ty, attrs) -> - let name = UriManager.name_of_uri (HExtlib.unopt uri) in - let obj = Cic.CurrentProof (name, metasenv, Lazy.force bo, ty, [], attrs) in + let name = UriManager.name_of_uri (HExtlib.unopt uri) in + let obj = + Cic.CurrentProof (name, metasenv, Lazy.force bo, ty, [], attrs) + in self#_loadObj obj | Incomplete_proof { proof = (uri, metasenv, _subst, bo, ty, attrs) } -> - let name = UriManager.name_of_uri (HExtlib.unopt uri) in - let obj = Cic.CurrentProof (name, metasenv, Lazy.force bo, ty, [], attrs) in + let name = UriManager.name_of_uri (HExtlib.unopt uri) in + let obj = + Cic.CurrentProof (name, metasenv, Lazy.force bo, ty, [], attrs) + in self#_loadObj obj - | _ -> self#blank () + | _ -> + match self#script#grafite_status#ng_mode with + `ProofMode -> self#_loadNObj self#script#grafite_status#obj + | _ -> self#blank () (** loads a cic uri from the environment * @param uri UriManager.uri *)