Snapshot.state: fall back on Command.empty_state -- looked-up command might be unavailable due to editing divergence;
--- a/src/Pure/PIDE/command.scala Sat Aug 14 22:45:23 2010 +0200
+++ b/src/Pure/PIDE/command.scala Sat Aug 14 23:01:53 2010 +0200
@@ -184,6 +184,6 @@
/* accumulated results */
- def empty_state: Command.State =
+ val empty_state: Command.State =
Command.State(this, Command.Status.UNPROCESSED, 0, Nil, new Markup_Text(Nil, source))
}
--- a/src/Pure/System/session.scala Sat Aug 14 22:45:23 2010 +0200
+++ b/src/Pure/System/session.scala Sat Aug 14 23:01:53 2010 +0200
@@ -317,7 +317,8 @@
def lookup_command(id: Document.Command_ID): Option[Command] =
state_snapshot.lookup_command(id)
def state(command: Command): Command.State =
- state_snapshot.command_state(document, command)
+ try { state_snapshot.command_state(document, command) }
+ catch { case _: State.Fail => command.empty_state }
}
}