Template editor spacing when using asset call won't align properly with shift-tab

Russ

Well-known member
Affected version
2.3
This has bugged me for a bit (maybe I'm doing something wrong).

But when using the template editor with the asset folder, you can't properly space things using shift-tab. You can test using this CSS:

Code:
.section
{
color: pink;
    &.section-feature
    {
    background: url(styles/default/xenforo/ellipse.png) no-repeat right center;
    color: yellow;
    .section-description    
        {
    font-size: @xf-fontSizeSmallest;
    }
    }
}



.section
{
color: pink;
    &.section-feature
    {
        background: url({{ asset('stylefolder') }}/xenforo/ellipse.png) no-repeat right center;
color: yellow;
.section-description
{
font-size: @xf-fontSizeSmallest;
}
}
}

The indents above are intentionally incorrect, paste that into extra.less and hit SHIFT-TAB to auto-correct. It works fine on the top section CSS but anytime there is an asset call, everything below it will not get shifted properly.

How it looks pasted initially:
1716057143023.webp


After shift-tab, below the asset folder call it's just messed up:
1716057192097.webp

Was a thing on 2.2 and still the same on 2.3.
 
CodeMirror doesn’t support our template syntax, so it's prone to strange formatting/highlighting sometimes. It’s kind of the similar to how JavaScript doesn’t get highlighted in <xf:js> tags. It might be possible to extend the language definition, but admittedly I'm not too familiar with the API so I don't know if it's worth the effort.
 
CodeMirror doesn’t support our template syntax, so it's prone to strange formatting/highlighting sometimes. It’s kind of the similar to how JavaScript doesn’t get highlighted in <xf:js> tags. It might be possible to extend the language definition, but admittedly I'm not too familiar with the API so I don't know if it's worth the effort.
Yeah not a big deal... more of an annoyance. Trying to figure out if there's some sort of line I could use to "reset" it somehow.
 
Back
Top Bottom