mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 07:53:26 +00:00
Fix Quick Open history
This commit is contained in:
parent
6e33e3b7af
commit
be53dd3d04
1 changed files with 12 additions and 2 deletions
|
@ -521,18 +521,28 @@ void QuickOpenResultContainer::update_results() {
|
|||
}
|
||||
|
||||
void QuickOpenResultContainer::_use_default_candidates() {
|
||||
HashSet<String> existing_paths;
|
||||
Vector<QuickOpenResultCandidate> *history = _get_history();
|
||||
if (history) {
|
||||
candidates.append_array(*history);
|
||||
for (const QuickOpenResultCandidate &candi : *history) {
|
||||
existing_paths.insert(candi.file_path);
|
||||
}
|
||||
}
|
||||
int i = candidates.size();
|
||||
|
||||
candidates.resize(MIN(max_total_results, filepaths.size()));
|
||||
QuickOpenResultCandidate *candidates_w = candidates.ptrw();
|
||||
int count = candidates.size();
|
||||
int i = 0;
|
||||
|
||||
for (const String &filepath : filepaths) {
|
||||
if (i >= count) {
|
||||
break;
|
||||
}
|
||||
_setup_candidate(candidates.write[i++], filepath);
|
||||
if (existing_paths.has(filepath)) {
|
||||
continue;
|
||||
}
|
||||
_setup_candidate(candidates_w[i++], filepath);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue