anaconda
anaconda copied to clipboard
AutoPEP8 stops repeated views from saving
If you open the same file twice, the autoformatting seems to cause both files to save and then reformat, making ST3 think they still need saving.
In my TODO list
Hi @erbridge
I don't see the way to fix this. We can tell ST3 to mark the view as scratch but this doesn't solve the problem because the autoformat command is run in an external process and handled asynchronous so when it finish we already saved the buffer and then it gets modified again when we have a result back from the autoformat asynchronous call.
Perhaps the best behaviour would be for autopep8 not to run if the view is open twice?
I find this also happens when the view is only open once.
This behavior is fixed with the bettercallbacks branch
@erbridge and @NorthIsUp Again, this should be fixed since the last release https://github.com/DamnWidget/anaconda/commit/d55249e3ad242023ca8d14177ae598dd76a762ca
Please, confirm and close. Thanks.
Nope. It still won't save multiple views onto the same file.
This was fixed a couple releases ago
This doesn't appear to be completely fixed. If you open two views on the same file and save one, the code is formatted, and the file is saved, however, ST3 seems to get stuck in a format save cycle. While that's happening, edits are hard to makes since many of them are instantly undone by the autoformatting.
A possible solution is to only run the formatter on the active view when two copies are open.
Yup I had to try several times until I could reproduce it
1. Summary
If I open same file in 2 tabs → make a typo → save file:
Anaconda breaks down and I need restart Sublime Text.
2. Steps to reproduce
3. Environment
I reproduce the problem in a version of Sublime Text without plugins and user settings.
- Windows 10 Enterprise LTSB 64-bit EN,
- Sublime Text Version 3.1.1, Build 3176 Portable,
- Python 3.7.0,
- Anaconda 2.1.29.
4. Configuration
User/Anaconda.sublime-settings
:
{
"auto_formatting": true
}
Thanks.