1

Currently 4 spaces have to be typed into the textarea manually to get the 4 space indention for code that spans multiple lines. I am aware of the code snippet feature but there is not always a code snippet that can be run as such. If there already exists a better way to do such a thing please let me know. It is hard putting in 4 spaces before every line especially when the snippet is very long.

1
  • @psubsee2003 My question was SO specific and not textarea in general
    – Anubhav
    Dec 5, 2014 at 15:52

1 Answer 1

0

This already exists. Instead of manually indenting every line, you can type the code in normally, select it, and click the "Code Sample" ({}) button above the question/answer box. This will indent the whole selection by four spaces per line so that it renders as text.

2
  • Or, select and hit Ctrl + K on the keyboard.
    – Oded
    Dec 5, 2014 at 15:48
  • 2
    I sometimes have to edit code after I have indented it. At that point, any inserted line has to have spaces typed manually. Dec 5, 2014 at 15:48

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