Open ubaldot opened 2 years ago
Hey @Ubaldo79, thanks for reporting. Do you have the Autoformat on save
option enabled?
That could be the cause of your problem.
Hello Carlos, many thanks for your reply. Yes, I actually have it selected and auto-formatting on save is something that I actually want.
What I would not want is the automatically unfolding of the folded parts, i.e. I want the code to be formatted on save, but please don’t unfold what is folded. :)
Yes, I actually have it selected and auto-formatting on save is something that I actually want.
Ok, I imagine that.
I want the code to be formatted on save, but please don’t unfold what is folded. :)
Unfortunately, this is not easy to do because it requires several important improvements in the editor. We'll try to address it next year.
Very good to hear! I am a very aggressive Spyder user and I absolutely don't want to change editor! :)
Issue Report Checklist
conda update spyder
(orpip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
Problem Description
During my work I use to fold functions and docstrings for better code reading, but every time I save everything got unfolded. Is it a normal behavior? Is there a way to prevent this behavior?
It is very annoying that you are focused on a part of code, and then you save and your current view got completely changed because of the unfolding of... everything.
What steps reproduce the problem?
Write any function/docstring in the editor and fold it. Do some work and save. You will see that everything that was folded got automatically unfolded.
What is the expected output? What do you see instead?
What was folded remain folded after having saved the file.
Versions
Dependencies