equal
deleted
inserted
replaced
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 } |