Repository: godotengine/godot
File: editor/editor_properties.cpp (C++)

Code before:
		} else if (slice == "degrees") {
			degrees = true;
		} else if (slice.begins_with("suffix:")) {
			hint.suffix = " " + slice.replace_first("suffix:", "").strip_edges();
		}
	}

	if ((hint.radians_as_degrees || degrees) && hint.suffix.is_empty()) {
		hint.suffix = U"\u00B0";
	}

	ERR_FAIL_COND_V_MSG(hint.step == 0, hint,
			vformat("Invalid PROPERTY_HINT_RANGE with hint \"%s\": Step cannot be 0.", p_hint_text));

	return hint;
}

static EditorProperty *get_input_action_editor(const String &p_hint_text, bool is_string_name) {
	// TODO: Should probably use a better editor GUI with a search bar.
	//Said GUI could also handle showing builtin options, requiring 1 less hint.
	EditorPropertyTextEnum *editor = memnew(EditorPropertyTextEnum);
	Vector<String> options;
	Vector<String> builtin_options;
	List<PropertyInfo> pinfo;
	ProjectSettings::get_singleton()->get_property_list(&pinfo);
	Vector<String> hints = p_hint_text.remove_chars(" ").split(",", false);

	//Code that shows an error when an invalid hint is entered
	//for (const String& hint : hints) {
	//    if (hint != "show_builtin" || hint != "loose_mode") {
	//        ERR_FAIL_V_MSG(get_input_action_editor("", is_string_name), vformat("Invalid PROPERTY_HINT_INPUT_NAME with hint \"%s\"", hint));
	//    }
	//}

	HashMap<String, List<Ref<InputEvent>>> builtins = InputMap::get_singleton()->get_builtins();
	bool show_builtin = hints.has("show_builtin");

	for (const PropertyInfo &pi : pinfo) {
		if (!pi.name.begins_with("input/")) {
			continue;
		}

		const String action_name = pi.name.get_slicec('/', 1);
		if (builtins.has(action_name)) {
			if (show_builtin) {
				builtin_options.append(action_name);
			}
		} else {
			options.append(action_name);
		}
	}

Review comment (suggestion):
```suggestion
	Vector<String> hints = p_hint_text.remove_char(' ').split(",", false);
```

Code after:
		ERR_FAIL_COND_V_MSG(slices.size() < 2, hint,
				vformat("Invalid PROPERTY_HINT_RANGE with hint \"%s\": Missing required min and/or max values.", p_hint_text));

		hint.or_greater = false; // If using ranged, assume false by default.
		hint.or_less = false;

		hint.min = slices[0].to_float();
		hint.max = slices[1].to_float();

		if (slices.size() >= 3 && slices[2].is_valid_float()) {
			// Step is optional, could be something else if not a number.
			hint.step = slices[2].to_float();
		}
		hint.hide_slider = false;
		for (int i = 2; i < slices.size(); i++) {
			String slice = slices[i].strip_edges();
			if (slice == "or_greater") {
				hint.or_greater = true;
			} else if (slice == "or_less") {
				hint.or_less = true;
			} else if (slice == "hide_slider") {
				hint.hide_slider = true;
			} else if (slice == "exp") {
				hint.exp_range = true;
			}
		}
	}
	bool degrees = false;
	for (int i = 0; i < slices.size(); i++) {
		String slice = slices[i].strip_edges();
		if (slice == "radians_as_degrees"
#ifndef DISABLE_DEPRECATED
				|| slice == "radians"
#endif // DISABLE_DEPRECATED
		) {
			hint.radians_as_degrees = true;
		} else if (slice == "degrees") {
			degrees = true;
		} else if (slice.begins_with("suffix:")) {
			hint.suffix = " " + slice.replace_first("suffix:", "").strip_edges();
		}
	}

	if ((hint.radians_as_degrees || degrees) && hint.suffix.is_empty()) {
		hint.suffix = U"\u00B0";
	}

	ERR_FAIL_COND_V_MSG(hint.step == 0, hint,
			vformat("Invalid PROPERTY_HINT_RANGE with hint \"%s\": Step cannot be 0.", p_hint_text));

	return hint;