### Godot version

v4.2.dev4.mono.official [549fcce5f]

### System information

window10 64bit

### Issue description

![GIF 2023-9-1 22-39-07](https://github.com/godotengine/godot/assets/35988767/d7be4a45-f5f0-4408-8758-f4bf9f3c9c5d)


### Steps to reproduce

/

### Minimal reproduction project

/
}
		if (match) {
			item_list->add_item(files.front()->get());
			if (get_icon_func) {
				Ref<Texture2D> icon = get_icon_func(cdir.path_join(files.front()->get()));
				if (display_mode == DISPLAY_THUMBNAILS) {
					Ref<Texture2D> thumbnail;
					if (get_thumbnail_func) {
						thumbnail = get_thumbnail_func(cdir.path_join(files.front()->get()));
					}
					if (thumbnail.is_null()) {
						thumbnail = file_thumbnail;
					}
					item_list->set_item_icon(-1, thumbnail);
					item_list->set_item_tag_icon(-1, icon);
				} else {
					item_list->set_item_icon(-1, icon);
				}
			}
			Dictionary d;
			d["name"] = files.front()->get();
			d["dir"] = false;
			String fullpath = cdir.path_join(files.front()->get());
			d["path"] = fullpath;
			item_list->set_item_metadata(-1, d);
			if (display_mode == DISPLAY_THUMBNAILS && previews_enabled) {
				EditorResourcePreview::get_singleton()->queue_resource_preview(fullpath, this, "_thumbnail_result", fullpath);
			}
			if (file->get_text() == files.front()->get()) {
				item_list->set_current(item_list->get_item_count() - 1);