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
Marco Bubke
flatpak-qt-creator
Commits
18e0777e
Commit
18e0777e
authored
Feb 01, 2010
by
Roberto Raggi
Browse files
Sort lower case items before upper case items in QML/JS completion.
Done with: Thorbjorn
parent
7b462f1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmljseditor/qmlcodecompletion.cpp
View file @
18e0777e
...
...
@@ -852,13 +852,23 @@ void QmlCodeCompletion::updateSnippets()
file
.
close
();
}
static
bool
qmlCompletionItemLessThan
(
const
TextEditor
::
CompletionItem
&
l
,
const
TextEditor
::
CompletionItem
&
r
)
{
if
(
l
.
text
.
at
(
0
).
isUpper
()
&&
r
.
text
.
at
(
0
).
isLower
())
return
false
;
else
if
(
l
.
text
.
at
(
0
).
isLower
()
&&
r
.
text
.
at
(
0
).
isUpper
())
return
true
;
return
l
.
text
<
r
.
text
;
}
QList
<
TextEditor
::
CompletionItem
>
QmlCodeCompletion
::
getCompletions
()
{
QList
<
TextEditor
::
CompletionItem
>
completionItems
;
completions
(
&
completionItems
);
qStableSort
(
completionItems
.
begin
(),
completionItems
.
end
(),
c
ompletionItemLessThan
);
qStableSort
(
completionItems
.
begin
(),
completionItems
.
end
(),
qmlC
ompletionItemLessThan
);
// Remove duplicates
QString
lastKey
;
...
...
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