Script code editor settigns

Hi everyone,
I am ‘extremely’ new to OH3 and I try to organize script code readably. However, OH3 continues to reformat the layout of the script.
Typing e.g. this:
var logger = Java.type(‘org.slf4j.LoggerFactory’).getLogger(‘org.openhab.rule.’+ctx.ruleUID);
var ScriptExecution = Java.type(“org.openhab.core.model.script.actions.ScriptExecution”);
var ZonedDateTime = Java.type(“java.time.ZonedDateTime”);
then after saving this, exiting and then entering edit mode again I see the text organized as:
var logger =
Java.type(‘org.slf4j.LoggerFactory’).getLogger(‘org.openhab.rule.’+ctx.ruleUID);
var ScriptExecution =
Java.type(“org.openhab.core.model.script.actions.ScriptExecution”); var
ZonedDateTime = Java.type(“java.time.ZonedDateTime”);
Is there a way to prevent this from happening?
Cheers,
Eric

Without code fences both the before and the after look the same or it’s unclear if the differences are the forum or real.

```
code goes here
```

Which version of OH 3? 3.0, 3.1.1, 3.2 M2, snapshot?

Hi Rich,
This relates to OH3.
Screenshot how the neat list is ’ twisted’ in the editor:


Any idea?
Thank you,
Eric

That’s the YAML view of the code. It’s going to look different from the actual editor which is in the Design tab because YAML has different constraints.

You probably shouldn’t be editing the code in that tab anyway because YAML is very sensitive to indentation. You could accidentally insert a space and blow away half of your code with no way to get it back.

So you should only use the Design tab to edit your Script Actions and Script Conditions. Format the code so it looks like you want there. The YAML and JSON will look different but the formatting you made in the Design tab will still be preserved and that’s where it matters.

As an aside, screen shots are even worse than posting code without code fences.