« first day (39 days earlier)      last day (2577 days later) » 

2:23 PM
Hi everyone.
Just a little question, maybe stupid but I didn't find anything.
Is there a shortcut or something else which indent code automatically?
 
2:34 PM
@MartinLezer Beyond ctrl+k to format something as a code block, there really isn't anything that helps with indentation. I think I know the question that prompted your question here, and I had to do the indentation by hand.
The only 'shortcut' that I used was copying the 4 spaces at the start of the first line of code, and repeatedly pasting it for subsequent lines (because hitting ctrl+v 5 times beats hitting space 20 times).
I've also copy/pasted code from a question into a basic code editor (notepad++) that allows me to highlight sections of code and press 'tab' once to indent the entire thing (or shift + tab to un-indent by one level). I'll then copy/paste it back into the question when I'm done.
 
2:54 PM
@DerekF Ok thanks !
I was asking myself if there was a shortcut or if people were less lazy than me.
Apparently this is the second option. :D
I'll use Notepad++ in the future.
 
3:36 PM
which question now?
 
http://salesforce.stackexchange.com/questions/165532/batch-apex-unable-to-lock-row

It was a mess of un-indented code. As a bonus, it also had inconsistently used newlines and braces.
 
3:57 PM
@DerekF Ah, that's always fun. You know if you paste it into the Execute Anonymous window in the Developer Console and hit Shift + Tab it will auto-indent for you.
4
No separate app, and it's pretty accurate/fast/convenient
And I usually already have it open
 
@AdrianLarson I did not know that. That's pretty damn cool.
 
Yeah immensely helpful for editing SFSE posts.
Might interest @MartinLezer as well. Seems like the right tool for the same job.
 
Starring that tip
 
4:28 PM
@AdrianLarson Yes thanks. Didn't know that either.
That's perfect
 
And then while you have everything selected just tab out one more time and then it's paste-ready into SFSE
 

« first day (39 days earlier)      last day (2577 days later) »