-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After python autosave, cursor moves to beginning of line #9787
Comments
Hey @dacort, can you capture a screen video? I haven't been able to reproduce this on my end. |
Sure thing! zed_repro.movNote that the file must already exist - in an unsaved buffer, this doesn't happen. |
Oh ok, I see what you are experiencing now, I was typing before the autosave triggered, so the line was non-empty for me. Yeah this is sort of a tricky situation because that setting is meant to strip the trailing whitespace off all lines. What would be a good fix to this? An option in the autosaver to not run those operations that trim newlines and whitespace? |
It is happening in SQL autosave too. |
…nless manually saved Autosave with delay will not format code when triggered, unless the user manually saves the code; added additional docs to the format_on_save setting. Previously autosave with delay would format the code, including the line the cursor was on, causing a poor user experience, as mentioned in the issue.
…nless manually saved Autosave with delay will not format code when triggered, unless the user manually saves the code; added additional docs to the format_on_save setting. Previously autosave with delay would format the code, including the line the cursor was on, causing a poor user experience, as mentioned in the issue.
Implemented autosave functionality with a delay, which now refrains from formatting the code upon triggering unless the user manually saves it. Additionally, enhanced documentation for the `format_on_save` setting has been added. This resolves the issue where autosave with delay would inadvertently format the code, disrupting the user experience, as reported in the corresponding issue. Release Notes: - Fixed a bug where autosave after_delay would auto-format the buffer ([#9787](#9787)). --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This is now available in Zed v0.136.0-pre. |
Implemented autosave functionality with a delay, which now refrains from formatting the code upon triggering unless the user manually saves it. Additionally, enhanced documentation for the `format_on_save` setting has been added. This resolves the issue where autosave with delay would inadvertently format the code, disrupting the user experience, as reported in the corresponding issue. Release Notes: - Fixed a bug where autosave after_delay would auto-format the buffer ([zed-industries#9787](zed-industries#9787)). --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Check for existing issues
Describe the bug / provide steps to reproduce it
When autosave is enabled, saving a Python file with an empty method definition results in the cursor moving from an indented position to the beginning of the line, resulting in a frustrating dev experience.
Autosave setting:
To reproduce:
Note that this happens even if the method definition is in the middle of a file. It appears to be related to the
remove_trailing_whitespace_on_save
setting - if I disable that, then the cursor remains in the same/correct position.Similar to #7570 and #392
Environment
Zed: v0.127.4 (Zed)
OS: macOS 14.3.1
Memory: 36 GiB
Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.No response
The text was updated successfully, but these errors were encountered: