Editing settings.json with format_on_save: any changes to json formatting options require two saves to apply
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
Only after editing the settings.json file and saving twice the setting for tab_size will be applied.
Environment
Zed: v0.150.0 (Zed Dev f7f5a255845b45ac33ab88bfdc023894034168b7) OS: Windows 10.0.22631 Memory: 63.1 GiB Architecture: x86_64 GPU: NVIDIA GeForce RTX 4090 || NVIDIA || 560.81
If applicable, add mockups / screenshots to help explain present your vision of the feature
https://github.com/user-attachments/assets/808099bf-7ec7-4535-9460-64693df559c1
If applicable, attach your Zed.log file to this issue.
Zed.log
Possibly related to
- https://github.com/zed-industries/zed/issues/15320
This is funky corner case. Normally you go ctrl-s to save a file, we only do anything if the buffer is dirty (something has changed). If you have format_on_save enabled it will trigger a format before it writes to disk. But it does so with the old formatting settings (tab size). Only on the next reformat (either by getting the buffer marked dirty and saving or manually triggering a format) will it know to use the new settings/
If you want to manually reformat you can trigger Editor: format from the command palette. (ctrl-shift-i on Linux/Windows or cmd-shift-i on Mac).
Ah I see, makes sense now
To note, project_panel.auto_fold_dirs setting reliably reproduces this behavior on two different set-ups (https://github.com/zed-industries/zed/discussions/16655#discussioncomment-10419146).
Hi there! 👋 We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Zed, please let us know by commenting on this issue, and we will keep it open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, we'll close it in 7 days. Thanks for your help!
This issue was closed due to inactivity. If you're still experiencing this problem, please open a new issue with a link to this issue.