corrected order
authorimmler@in.tum.de
Mon, 07 Sep 2009 13:52:36 +0200
changeset 34718 39e3039645ae
parent 34717 3f32e08bbb6c
child 34719 f5b408849dcc
corrected order
src/Tools/jEdit/src/jedit/TheoryView.scala
--- a/src/Tools/jEdit/src/jedit/TheoryView.scala	Sun Sep 06 22:27:32 2009 +0200
+++ b/src/Tools/jEdit/src/jedit/TheoryView.scala	Mon Sep 07 13:52:36 2009 +0200
@@ -197,14 +197,15 @@
 
   /* transforming offsets */
 
-  private def changes_to(doc: ProofDocument): List[Edit] =
-    edits.toList ::: List.flatten(current_change.ancestors(_.id == doc.id).map(_.edits))
+  private def changes_from(doc: ProofDocument): List[Edit] =
+    List.flatten(current_change.ancestors(_.id == doc.id).reverse.map(_.edits)) :::
+      edits.toList
 
   def from_current(doc: ProofDocument, offset: Int): Int =
-    (offset /: changes_to(doc)) ((i, change) => change before i)
+    (offset /: changes_from(doc).reverse) ((i, change) => change before i)
 
   def to_current(doc: ProofDocument, offset: Int): Int =
-    (offset /: changes_to(doc).reverse) ((i, change) => change after i)
+    (offset /: changes_from(doc)) ((i, change) => change after i)
 
 
   private def lines_of_command(cmd: Command) =