text_edits/recover_spans: reparse at least until line boundary -- increases chance of recovery for bad ML text, for example;
--- a/src/Pure/Thy/thy_syntax.scala Mon Aug 30 20:11:21 2010 +0200
+++ b/src/Pure/Thy/thy_syntax.scala Mon Aug 30 20:12:43 2010 +0200
@@ -77,9 +77,11 @@
commands.iterator.find(_.is_unparsed) match {
case Some(first_unparsed) =>
val first =
- commands.reverse_iterator(first_unparsed).find(_.is_command) getOrElse commands.head
+ commands.reverse_iterator(first_unparsed).
+ dropWhile(_.newlines == 0).find(_.is_command) getOrElse commands.head
val last =
- commands.iterator(first_unparsed).find(_.is_command) getOrElse commands.last
+ commands.iterator(first_unparsed).
+ dropWhile(_.newlines == 0).find(_.is_command) getOrElse commands.last
val range =
commands.iterator(first).takeWhile(_ != last).toList ::: List(last)