Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only display 15 nodes in the Recent section of the Create New Node dialog #78309

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions editor/create_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ float CreateDialog::_score_type(const String &p_type, const String &p_search) co

// Look through at most 5 recent items
bool in_recent = false;
for (int i = 0; i < MIN(5, recent->get_item_count()); i++) {
constexpr int RECENT_COMPLETION_SIZE = 5;
for (int i = 0; i < MIN(RECENT_COMPLETION_SIZE - 1, recent->get_item_count()); i++) {
if (recent->get_item_text(i) == p_type) {
in_recent = true;
break;
Expand Down Expand Up @@ -406,7 +407,8 @@ void CreateDialog::_confirmed() {
if (f.is_valid()) {
f->store_line(selected_item);

for (int i = 0; i < MIN(32, recent->get_item_count()); i++) {
constexpr int RECENT_HISTORY_SIZE = 15;
for (int i = 0; i < MIN(RECENT_HISTORY_SIZE - 1, recent->get_item_count()); i++) {
if (recent->get_item_text(i) != selected_item) {
f->store_line(recent->get_item_text(i));
}
Expand Down