src/Tools/jEdit/src/proofdocument/ProofDocument.scala
changeset 34516 73225f520f8c
parent 34505 87f4f70d61bb
child 34526 b504abb6eff6
child 34534 b06946a1d4cb
equal deleted inserted replaced
34515:3be515f1379d 34516:73225f520f8c
   227   
   227   
   228   /** command view **/
   228   /** command view **/
   229 
   229 
   230   val structural_changes = new EventBus[StructureChange]
   230   val structural_changes = new EventBus[StructureChange]
   231 
   231 
   232   def commands = new Iterator[Command] {
   232   def commands_from(start: Token) = new Iterator[Command] {
   233     var current = first_token
   233     var current = start
   234     def hasNext = current != null
   234     def hasNext = current != null
   235     def next() = { val s = current.command ; current = s.last.next ; s }
   235     def next = { val s = current.command ; current = s.last.next ; s }
   236   }
   236   }
       
   237   def commands_from(start: Command): Iterator[Command] = commands_from(start.first)
       
   238   def commands = commands_from(first_token)
   237 
   239 
   238   def find_command_at(pos: Int): Command = {
   240   def find_command_at(pos: Int): Command = {
   239     for (cmd <- commands) { if (pos < cmd.stop) return cmd }
   241     for (cmd <- commands) { if (pos < cmd.stop) return cmd }
   240     return null
   242     return null
   241   }
   243   }