Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

Although the code block does a good job of auto formatting code most of time it does mess up occasionally and when editing often exhibits some strange behavior such as splitting the code block which can result in bad formatting which is not corrected by re-selecting code block.

Is there anyway as a work around you could map a key to produce 4 spaces, It would make life sooo much easier when correcting code layout.

share|improve this question
I think it's because the tab bar is used by the browser to change focus to the next input box. – woz Dec 19 '12 at 18:33
yeh I get that, but couldn't Ctrl+space or something similar be mapped to do it – WebweaverD Dec 19 '12 at 18:34
After you paste the code, just select it all and hit Ctrl-K to indent it all at once. – Bill the Lizard Dec 19 '12 at 18:34
really? ...I'm gonna go try that – WebweaverD Dec 19 '12 at 18:35
Yes, really: How do I format my code blocks? – Arjan Dec 19 '12 at 18:37
No no no, that just does the same thing as the code block button - I know about that, which dont get me wrong works great sometimes. But when you start editing it to strip parts out or add comments it often goes wrong - or if you have tab space mixes. It's when you need to correct it it becomes a pain – WebweaverD Dec 19 '12 at 18:40
1… – balpha Dec 19 '12 at 18:47
@balpha Just took a look at that link, and that is exactly what I want. But it's not what happens when I use SO, cause if I press tab it moves out the question box. What do I do with the download to make it happen? – WebweaverD Dec 19 '12 at 18:56
Depends on the browser you're using, see – balpha Dec 19 '12 at 19:07
Then vote for Automatic code reindent button? – Arjan Dec 19 '12 at 19:27
@Arjan - I've just done that, What I am asking for is what has been suggested as the answer (not whats asked in the question - I suspected that was asking a lot) - increase/decrease indent buttons with a shortcut key – WebweaverD Dec 19 '12 at 19:35
@balpha thanks for the link, I will get that set up – WebweaverD Dec 19 '12 at 19:36

What I do is that I write a all of the code I need to the post, or paste all of the code in, then I highlight it and press CTRL + K

share|improve this answer
I didnt know about the shortcut but I knew about the code block. I'm speaking more about when the auto-formatting doesnt work properly... which seems to happen a lot especially when editing in the question window – WebweaverD Dec 19 '12 at 18:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .