DamnWidget / anaconda

Anaconda turns your Sublime Text 3 in a full featured Python development IDE including autocompletion, code linting, IDE features, autopep8 formating, McCabe complexity checker Vagrant and Docker support for Sublime Text 3 using Jedi, PyFlakes, pep8, MyPy, PyLint, pep257 and McCabe that will never freeze your Sublime Text 3
http://damnwidget.github.io/anaconda/
GNU General Public License v3.0
2.21k stars 260 forks source link

AutoPEP8 stops repeated views from saving #163

Open erbridge opened 10 years ago

erbridge commented 10 years ago

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.

DamnWidget commented 10 years ago

In my TODO list

DamnWidget commented 10 years ago

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.

erbridge commented 10 years ago

Perhaps the best behaviour would be for autopep8 not to run if the view is open twice?

NorthIsUp commented 10 years ago

I find this also happens when the view is only open once.

NorthIsUp commented 10 years ago

This behavior is fixed with the bettercallbacks branch

DamnWidget commented 10 years ago

@erbridge and @NorthIsUp Again, this should be fixed since the last release https://github.com/DamnWidget/anaconda/commit/d55249e3ad242023ca8d14177ae598dd76a762ca

Please, confirm and close. Thanks.

erbridge commented 10 years ago

Nope. It still won't save multiple views onto the same file.

DamnWidget commented 8 years ago

This was fixed a couple releases ago

erbridge commented 8 years 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.

DamnWidget commented 8 years ago

Yup I had to try several times until I could reproduce it

Kristinita commented 6 years ago

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

Anaconda autoformatting

3. Environment

I reproduce the problem in a version of Sublime Text without plugins and user settings.

4. Configuration

User/Anaconda.sublime-settings:

{
    "auto_formatting": true
}

Thanks.