Today I’ve catched a quite nasty ST bug, it happens when you decide to replace ocurrences from folded code, it’s quite destructive behaviour in fact and it will make you waste tons of time wondering why your code has been broken strangely if you’re not totally aware of it.
Personal story, In the past after doing some heavy refactoring (long time refactoring without running any test) of large python folded code (using alt+f3 quick_find_all command quite intensively) I’d end up running auto-pep8 and finally running my tests, but… what was my surprise after all the heavy refactoring? The code was totally broken misteriously!!! I was shocked without understanding at all what had happened as I tend to refactor stuff quite methodically… So my first thought would be blaming that auto-pep8 couldn’t handle folded code properly… Since that moment I just stop running autopep8 with folded code as a golden rule. At that time I didn’t suspect ST3 wasn’t able to handle folded code properly (i considered reliable by definition), today I’ve realized code-folded replacements are potential destructive actions on ST3 build 3131, here’s a little MCVE which exposing the nasty behaviour:
class Bar():
def f():
a = Foo.foooooooooo_bar()
pass
class Foo():
def foooooooooo_bar():
pass
And breaking the code is as easy as doing something like this.
Well… the good news are at least now I’m aware of the really destructive behaviour so it’ll be my responsability if I break the code by doing so but it’s a shame all the wasted time because of it.
In any case, it’s strange this destructive behaviour has been living in ST till version3… as ocurrence replacements should be rock-solid in a text editor by definition since the very beginning.
Thanks in advance.


… at first I got annoyed and I was trying desperately rolling back… But then I decided to give it a shot and now I’ve got used to it and the new UI feels normal again