--- a/src/Pure/library.scala Wed Nov 10 20:21:55 2010 +0100
+++ b/src/Pure/library.scala Wed Nov 10 20:43:22 2010 +0100
@@ -82,6 +82,13 @@
}
}
+ def first_line(source: CharSequence): String =
+ {
+ val lines = chunks(source)
+ if (lines.hasNext) lines.next.toString
+ else ""
+ }
+
/* simple dialogs */
--- a/src/Tools/jEdit/src/jedit/isabelle_sidekick.scala Wed Nov 10 20:21:55 2010 +0100
+++ b/src/Tools/jEdit/src/jedit/isabelle_sidekick.scala Wed Nov 10 20:43:22 2010 +0100
@@ -121,7 +121,7 @@
case Structure.Block(name, body) =>
val node =
new DefaultMutableTreeNode(
- new Isabelle_Sidekick.Asset(name, offset, offset + entry.length))
+ new Isabelle_Sidekick.Asset(Library.first_line(name), offset, offset + entry.length))
(offset /: body)((i, e) =>
{
make_tree(i, e) foreach (nd => node.add(nd))