summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcodecompletion.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-07-24 14:32:39 +0200
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-07-24 14:32:39 +0200
commit9412b138b6e3fc29e7d1a8c378d83ffaf40b026b (patch)
treedc34e12ae49f7413bb2784ace1c288a553ef82db /src/plugins/cpptools/cppcodecompletion.cpp
parent5271117e5be82b5ff80bb972e1638ee98c5b9725 (diff)
downloadqt-creator-9412b138b6e3fc29e7d1a8c378d83ffaf40b026b.tar.gz
Made trailing slash trigger the next include completion
The completion for the directory wasn't triggered because one of the items matched the typed string, so the list of completion wasn't empty and no new trigger was allowed. By not matching items when a trailing slash is typed, the list is allowed to trigger again from the new location. Reviewed-by: Daniel Molkentin <daniel.molkentin@nokia.com>
Diffstat (limited to 'src/plugins/cpptools/cppcodecompletion.cpp')
-rw-r--r--src/plugins/cpptools/cppcodecompletion.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp
index 8fac72b95e..21085093cf 100644
--- a/src/plugins/cpptools/cppcodecompletion.cpp
+++ b/src/plugins/cpptools/cppcodecompletion.cpp
@@ -1386,6 +1386,12 @@ void CppCodeCompletion::completions(QList<TextEditor::CompletionItem> *completio
else if (length > 0) {
const QString key = m_editor->textAt(m_startPosition, length);
+ /* Close on the trailing slash for include completion, to enable the slash to
+ * trigger a new completion list. */
+ if ((m_completionOperator == T_STRING_LITERAL ||
+ m_completionOperator == T_ANGLE_STRING_LITERAL) && key.endsWith(QLatin1Char('/')))
+ return;
+
if (m_completionOperator != T_LPAREN) {
/*
* This code builds a regular expression in order to more intelligently match