--- a/src/Tools/jEdit/src/structure_matching.scala Tue Oct 21 20:45:05 2014 +0200
+++ b/src/Tools/jEdit/src/structure_matching.scala Tue Oct 21 21:02:36 2014 +0200
@@ -58,6 +58,20 @@
iterator(caret_line, 1).find(info => info.range.touches(caret)) match
{
+ case Some(Text.Info(range1, tok)) if syntax.command_kind(tok, Keyword.theory_goal) =>
+ find_block(
+ syntax.command_kind(_, Keyword.proof_goal),
+ syntax.command_kind(_, Keyword.qed),
+ syntax.command_kind(_, Keyword.qed_global),
+ caret_iterator())
+
+ case Some(Text.Info(range1, tok)) if syntax.command_kind(tok, Keyword.proof_goal) =>
+ find_block(
+ syntax.command_kind(_, Keyword.proof_goal),
+ syntax.command_kind(_, Keyword.qed),
+ _ => false,
+ caret_iterator())
+
case Some(Text.Info(range1, tok)) if syntax.command_kind(tok, Keyword.qed_global) =>
rev_caret_iterator().find(info => syntax.command_kind(info.info, Keyword.theory))
match {
@@ -66,6 +80,15 @@
case _ => None
}
+ case Some(Text.Info(range1, tok)) if syntax.command_kind(tok, Keyword.qed) =>
+ find_block(
+ syntax.command_kind(_, Keyword.qed),
+ t =>
+ syntax.command_kind(t, Keyword.proof_goal) ||
+ syntax.command_kind(t, Keyword.theory_goal),
+ _ => false,
+ rev_caret_iterator())
+
case Some(Text.Info(range1, tok)) if tok.is_begin =>
find_block(_.is_begin, _.is_end, _ => false, caret_iterator())