mirror of
https://github.com/godotengine/godot.git
synced 2025-01-24 19:01:22 +00:00
Editor autocomplete: prefer same case candidates
This commit is contained in:
parent
b6b722d5c1
commit
109028f52b
@ -5770,8 +5770,11 @@ void TextEdit::_update_completion_candidates() {
|
|||||||
}
|
}
|
||||||
// Calculate the similarity to keep completions in good order
|
// Calculate the similarity to keep completions in good order
|
||||||
float similarity;
|
float similarity;
|
||||||
if (completion_strings[i].to_lower().begins_with(s.to_lower())) {
|
if (completion_strings[i].begins_with(s)) {
|
||||||
// Substrings are the best candidates
|
// Substrings (same case) are the best candidates
|
||||||
|
similarity = 1.2;
|
||||||
|
} else if (completion_strings[i].to_lower().begins_with(s.to_lower())) {
|
||||||
|
// then any substrings
|
||||||
similarity = 1.1;
|
similarity = 1.1;
|
||||||
} else {
|
} else {
|
||||||
// Otherwise compute the similarity
|
// Otherwise compute the similarity
|
||||||
|
Loading…
Reference in New Issue
Block a user