Skip to content

Fix truncated Directory when selecting #184

Open
Pheubel wants to merge 1 commit into
MakovWait:mainfrom
Pheubel:main
Open

Fix truncated Directory when selecting #184
Pheubel wants to merge 1 commit into
MakovWait:mainfrom
Pheubel:main

Conversation

@Pheubel
Copy link
Copy Markdown

@Pheubel Pheubel commented May 25, 2026

Resolves #175

Removed get_base_dir() call to prevent the current selected directory from being truncated from the path for the project.

Explanation

(taken from #175 (comment))

Looking into it, this bit of code seems to be causing the issue:

func _update_project_dir() -> void:
	var new_name: String = _project_name_edit.text
	if not _set_custom_folder:
		var base_dir := _project_path_line_edit.text.get_base_dir()  <- this line
		if not _create_folder_check.button_pressed:
			_project_path_line_edit.text = base_dir
		else:
			_project_path_line_edit.text = base_dir.path_join(_format_dir_name(new_name))
	_validate()

what happens is that earlier _project_path_line_edit.text gets set to base/current. for example User/Documents/Godot Projects. when var base_dir := _project_path_line_edit.text.get_base_dir() happens, it strips the end of the path to no longer point to the current selected directory, but instead the one above. so with the previous example, it would turn into User/Documents.

Removed get_base_dir() call to prevent the current selected directory from being truncated from the path for the project
@Pheubel
Copy link
Copy Markdown
Author

Pheubel commented May 25, 2026

This does raise the question if there are any other places where the handling of the selected directory is running into issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Godots keeps defaulting to Documents

1 participant