Sublime Forum

How to stop ST4 inserting extra TABs on ENTER?

#1

How to stop ST4 inserting extra TABs on ENTER?

Initial state:
image

After ENTER is pressed: actual:
image

After ENTER is pressed: wanted:
image

How?

0 Likes

#2

Does that happen in Safe Mode?

0 Likes

#3

Yes, it does.

Here is the reason: before it happens there is this code:

#define	X\
	{\
	}

So, ST4 (or some C/C++ plugin) takes the {} into account and keeps formatting the rest of the code based on the {}, i.e. inserting 1 TAB.

Demo:
image

Is it a bug/defect?

0 Likes

#4

Something similar was already reported and fixed, maybe it also fixed this use case. Not sure which is the earliest build of ST the fix was included in though

0 Likes

#5

@kingkeith Thanks!

0 Likes