3

Possible Duplicate:
Add increase/decrease tab indent buttons to the editor toolbar

When posting code inside a list you need to indent it by an additional level, i.e. 8 instead of just 4 spaces. The CTRL+K shortcut and the Code button of the editor use the regular 4-space indentation though which is annoying since it requires indenting all the code manually.

marked as duplicate by Cody Gray, Arjan, Manishearth, kiamlaluno, jonsca Jul 18 '12 at 3:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • This is a very well-known issue. – John Saunders Mar 20 '12 at 11:54
  • 3
    Doesn't make it less annoying :) – ThiefMaster Mar 20 '12 at 13:41
5

As a workaround:

  • Format your code using Ctrl-K:

    - List item
    
         Code line 1
         Code line 2
    
  • Add a dummy character at the very start of the first (formatted) line:

    - List item
    
    x     Code line 1
         Code line 2
    
  • Select all lines of code, hit Ctrl-K again.

  • Remove the dummy character:

    - List item
    
            Presto!
            And easier than letting the editor guess what you want...
    

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