--- a/src/Pure/Thy/completion.scala Wed Dec 16 14:24:18 2009 +0100
+++ b/src/Pure/Thy/completion.scala Wed Dec 16 15:15:39 2009 +0100
@@ -116,13 +116,14 @@
abbrevs_lex.parse(abbrevs_lex.keyword, new Completion.Reverse(line)) match {
case abbrevs_lex.Success(rev_a, _) =>
val (word, c) = abbrevs_map(rev_a)
- Some(word, List(c))
+ if (word == c) None
+ else Some(word, List(c))
case _ =>
Completion.Parse.read(line) match {
case Some(word) =>
- words_lex.completions(word) match {
+ words_lex.completions(word).map(words_map(_)).filter(_ != word) match {
case Nil => None
- case cs => Some(word, cs.map(words_map(_)).sort(Completion.length_ord _))
+ case cs => Some (word, cs.sort(Completion.length_ord _))
}
case None => None
}