anaconda icon indicating copy to clipboard operation
anaconda copied to clipboard

AutoPEP8 stops repeated views from saving

Open erbridge opened this issue 10 years ago • 11 comments

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.

erbridge avatar May 14 '14 10:05 erbridge

In my TODO list

DamnWidget avatar May 16 '14 08:05 DamnWidget

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.

DamnWidget avatar May 21 '14 22:05 DamnWidget

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

erbridge avatar Jul 07 '14 23:07 erbridge

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

NorthIsUp avatar Jul 28 '14 15:07 NorthIsUp

This behavior is fixed with the bettercallbacks branch

NorthIsUp avatar Aug 05 '14 15:08 NorthIsUp

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

Please, confirm and close. Thanks.

DamnWidget avatar Aug 13 '14 19:08 DamnWidget

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

erbridge avatar Aug 14 '14 10:08 erbridge

This was fixed a couple releases ago

DamnWidget avatar May 11 '16 18:05 DamnWidget

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.

erbridge avatar May 11 '16 20:05 erbridge

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

DamnWidget avatar May 11 '16 21:05 DamnWidget

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.

  • 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.

Kristinita avatar Aug 23 '18 07:08 Kristinita