From 7c04d11f4455e0e2d54dae48487efea4c3385e77 Mon Sep 17 00:00:00 2001
From: Roberto Raggi <roberto.raggi@nokia.com>
Date: Mon, 29 Mar 2010 10:49:21 +0200
Subject: [PATCH] Automagically hide the completion box when the text under
 cursor matches the only item in the completion box.

---
 src/plugins/qmljseditor/qmljscodecompletion.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/plugins/qmljseditor/qmljscodecompletion.cpp b/src/plugins/qmljseditor/qmljscodecompletion.cpp
index 139e034539c..57854d514a7 100644
--- a/src/plugins/qmljseditor/qmljscodecompletion.cpp
+++ b/src/plugins/qmljseditor/qmljscodecompletion.cpp
@@ -796,6 +796,11 @@ void CodeCompletion::completions(QList<TextEditor::CompletionItem> *completions)
         const QString key = m_editor->textAt(m_startPosition, length);
 
         filter(m_completions, completions, key, FirstLetterCaseSensitive);
+
+        if (completions->size() == 1) {
+            if (key == completions->first().text)
+                completions->clear();
+        }
     }
 }
 
-- 
GitLab