Skip to content
New issue

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

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

Already on GitHub? # to your account

Save untitled files to the last active folder #13184

Merged
merged 1 commit into from
Dec 19, 2023
Merged

Conversation

msujew
Copy link
Member

@msujew msujew commented Dec 18, 2023

What it does

Closes #13182

The changes to UserWorkingDirectoryProvider will now keep track of the latest opened navigatable resource. In case the current file doesn't use a valid URI scheme (i.e. untitled), it will now always default to the latest opened resource.

The changes in DefaultFileDialogService ensure that in case no resource has been opened yet, it will default to the first open workspace folder or the user home directory.

How to test

  1. Create an untitled file.
  2. Try to save it. The save dialog should point to the current workspace folder/home directory (in case of no workspace)
  3. Open a different file in the workspace.
  4. Try to save the untitled file again. The save dialog should point to the parent folder of the last opened file.
  5. Running Save As... on existing files should behave as expected (i.e. save to their parent folder).

Review checklist

Reminder for reviewers

@msujew msujew added file dialog issues related to the file dialog ui/ux issues related to user interface / user experience labels Dec 18, 2023
@JonasHelming JonasHelming requested review from planger and martin-fleck-at and removed request for martin-fleck-at December 18, 2023 15:27
Copy link
Contributor

@martin-fleck-at martin-fleck-at left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good to me and works as advertised, thank you @msujew!

@msujew msujew merged commit 2527596 into master Dec 19, 2023
13 checks passed
@github-actions github-actions bot added this to the 1.45.0 milestone Dec 19, 2023
@msujew msujew deleted the msujew/new-file-dir branch December 19, 2023 15:54
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
file dialog issues related to the file dialog ui/ux issues related to user interface / user experience
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Use better default location for saving untitled resources
2 participants