src/Pure/Thy/completion.scala
changeset 34093 3d654643cf56
parent 31780 d78e5cff9a9f
child 34097 9274a44358c4
--- a/src/Pure/Thy/completion.scala	Wed Dec 16 14:15:24 2009 +0100
+++ b/src/Pure/Thy/completion.scala	Wed Dec 16 15:15:05 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
         }