equal
deleted
inserted
replaced
192 abstract class Snapshot |
192 abstract class Snapshot |
193 { |
193 { |
194 val version: Version |
194 val version: Version |
195 val node: Node |
195 val node: Node |
196 val is_outdated: Boolean |
196 val is_outdated: Boolean |
197 def lookup_command(id: Command_ID): Option[Command] |
197 def find_command(id: Command_ID): Option[(String, Node, Command)] |
198 def state(command: Command): Command.State |
198 def state(command: Command): Command.State |
199 def convert(i: Text.Offset): Text.Offset |
199 def convert(i: Text.Offset): Text.Offset |
200 def convert(range: Text.Range): Text.Range |
200 def convert(range: Text.Range): Text.Range |
201 def revert(i: Text.Offset): Text.Offset |
201 def revert(i: Text.Offset): Text.Offset |
202 def revert(range: Text.Range): Text.Range |
202 def revert(range: Text.Range): Text.Range |
368 { |
368 { |
369 val version = stable.version.get_finished |
369 val version = stable.version.get_finished |
370 val node = version.nodes(name) |
370 val node = version.nodes(name) |
371 val is_outdated = !(pending_edits.isEmpty && latest == stable) |
371 val is_outdated = !(pending_edits.isEmpty && latest == stable) |
372 |
372 |
373 def lookup_command(id: Command_ID): Option[Command] = State.this.lookup_command(id) |
373 def find_command(id: Command_ID): Option[(String, Node, Command)] = |
|
374 State.this.lookup_command(id) match { |
|
375 case None => None |
|
376 case Some(command) => |
|
377 version.nodes.find({ case (_, node) => node.commands(command) }) |
|
378 .map({ case (name, node) => (name, node, command) }) |
|
379 } |
374 |
380 |
375 def state(command: Command): Command.State = |
381 def state(command: Command): Command.State = |
376 try { |
382 try { |
377 the_exec(the_assignment(version).check_finished.command_execs |
383 the_exec(the_assignment(version).check_finished.command_execs |
378 .getOrElse(command.id, fail)) |
384 .getOrElse(command.id, fail)) |