--- a/src/Tools/jEdit/src/jedit/document_model.scala Sun Jan 10 16:40:21 2010 +0100
+++ b/src/Tools/jEdit/src/jedit/document_model.scala Sun Jan 10 17:10:32 2010 +0100
@@ -64,14 +64,7 @@
new Change(document_0.id, None, Nil, Future.value(Nil, document_0))
def current_change(): Change = history
-
- def recent_document(): Document =
- {
- def find(change: Change): Change =
- if (change.result.is_finished && change.join_document.assignment.is_finished) change
- else find(change.parent.get)
- find(current_change()).join_document
- }
+ def recent_document(): Document = current_change().ancestors.find(_.is_assigned).get.join_document
/* transforming offsets */
--- a/src/Tools/jEdit/src/proofdocument/change.scala Sun Jan 10 16:40:21 2010 +0100
+++ b/src/Tools/jEdit/src/proofdocument/change.scala Sun Jan 10 17:10:32 2010 +0100
@@ -26,6 +26,7 @@
}
def join_document: Document = result.join._2
+ def is_assigned: Boolean = result.is_finished && join_document.assignment.is_finished
def edit(session: Session, edits: List[Text_Edit]): Change =
{