Sublime Forum

Sublime IDE broke my code

#1

Working in linux, using personal license that i payed for…
After mistakenly hitting F9 all line is the code were sorted, and undo is not working…
thx… for who ever implemented that useless crap in a c++ editor meniu…
and this while having a.cpp file open…

and with no backup…

0 Likes

#2

How large is the file? No option to checkout the particular file in git or your choice of SCM in a new branch?
I’m also on ST3 and F5 sorts my lines and Undo works for me.

0 Likes

#3

If you did not save the changes to your file afterwards, there shouldn’t be a problem.

Undo works fine for me.

0 Likes

#4

i think it saved when i changed to another file… i don’t know why it got saved… but i start from scratch the last SCM backup was 1 day ago…

just saying…

EDIT: it is highly unusual to sort all the lines in a c/c++ file… one should throw a warning before commencing such an operation on an identified prog. language file

Yeah, and the reason i ended up here, is i was trying to convince the build system to start building using make all.
But i dont know what happened this system broke for me since a couple of versions, and i just couldnt find the time to fix it

0 Likes

#5

In that case you might have auto_save enabled in your preferences.

0 Likes

#6

You can’t blame editor for allowing you to do destructive actions to a file. You should blame yourself for:
a) Not using git or similar version control system for your code
b) For pressing the buttons randomly and expecting nothing to happen
c) For changing default settings without understanding the implications (Sublime by default doesn’t save files automatically and even if it does on some actions, the undo normally works).

So unless you have some bug to report (like undo doesn’t work in some situations or file is saved when it shouldn’t), I don’t see the point in this thread.

4 Likes

#7

I’d suggest changing your key-bindings… so you don’t run into that again.

0 Likes

#8
  • Undo works on the sort operation (just tried it)
  • Don’t save a file if you accidentally perform an operation you didn’t expect. And frankly, resorting is sufficiently visible that you must have seen it prior to saving or paging away
  • Git? Or any version control system, honestly. This is why they exist.
  • Local backups. If you aren’t backing up your local filesystem through some mechanism (any mechanism), you’re asking for bigger problems than a simple resorted file
  • Why are you hitting random editor buttons without knowing what they do?

I mean, I don’t mean to sound condescending, but… honestly, PEBKAC. It’s an editor. It changes files. It gives you plenty of tools to fix mistakes if and when you make them, and there are plenty of external industry-standard tools which also serve the same function. You can’t blame Sublime here.

1 Like