Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
8069c174
Commit
8069c174
authored
Dec 14, 2010
by
Roberto Raggi
Browse files
Don't popup the automatic completion box when the identifier under cursor is a complete valid word.
parent
bb55460c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cppcodecompletion.cpp
View file @
8069c174
...
...
@@ -715,6 +715,31 @@ int CppCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
{
int
index
=
startCompletionHelper
(
editor
);
if
(
index
!=
-
1
)
{
if
(
m_automaticCompletion
)
{
const
int
pos
=
editor
->
position
();
const
QChar
ch
=
editor
->
characterAt
(
pos
);
if
(
!
(
ch
.
isLetterOrNumber
()
||
ch
==
QLatin1Char
(
'_'
)))
{
for
(
int
i
=
pos
-
1
;;
--
i
)
{
const
QChar
ch
=
editor
->
characterAt
(
i
);
if
(
ch
.
isLetterOrNumber
()
||
ch
==
QLatin1Char
(
'_'
))
{
const
QString
wordUnderCursor
=
editor
->
textAt
(
i
,
pos
-
i
);
if
(
wordUnderCursor
.
at
(
0
).
isLetter
()
||
wordUnderCursor
.
at
(
0
)
==
QLatin1Char
(
'_'
))
{
foreach
(
const
TextEditor
::
CompletionItem
&
i
,
m_completions
)
{
if
(
i
.
text
==
wordUnderCursor
)
{
cleanup
();
return
-
1
;
}
}
}
else
{
cleanup
();
return
-
1
;
}
}
else
break
;
}
}
}
if
(
m_completionOperator
!=
T_EOF_SYMBOL
)
qSort
(
m_completions
.
begin
(),
m_completions
.
end
(),
completionItemLessThan
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment