Sublime Forum

Indentation on Return - Bug or Feature?

#1

If I have code like this (tabs shown as 4x dashes, cursor as vertical pipe):

this ----is ----indented ----| ----like ----so

I will often Return-Return-Uparrow to insert two lines and move the cursor up. I expect to see this:

[code]this
----is
----indented

----

----like
----so[/code]

but instead, I get this:

[code]this
----is
----indented

----like
----so[/code]

How do I make it keep the tabs? Additionally, if I have:

[code]----some

----|
----code[/code]

and backspace twice, I expect it to delete the tab then the line break, resulting in this:

----some ----| ----code

but it gives this:

----some | ----code

Any ideas what setting affects this and how to fix it?

0 Likes

#2

Add the following to your user preferences

"trim_automatic_white_space": false
0 Likes

#3

Thanks! I looked through the options but missed that one, it wasn’t particularly obvious. It now works as expected. :smile:

0 Likes