stylus icon indicating copy to clipboard operation
stylus copied to clipboard

[Bug] Indenting when "Indent @-moz-document" unchecked

Open joes-mama opened this issue 2 years ago • 15 comments

Bug Report

Bug Description

If the "Indent @-moz-document" beautify setting is unchecked, properties are no longer indented and an empty line is added below the last property.

Screenshots

settings before after

System Information

  • OS: Windows 10 22H2
  • Browser: Firefox 108.0
  • Stylus Version: 1.5.33 (& also 1.5.31)

Additional Context

I have not changed any of my beautify settings. I have confirmed that this problem persists after turning all of my styles off. I have restarted the browser several times, updated Stylus (from 1.5.31 to 1.5.31) , and have checked in another Firefox profile. My educated guess is that this bug was introduced with the recently added additional beautify settings.

Please fix soon because the beautify tool is now useless unless I enable "Indent @-moz-document" (which I will not do). I love Stylus but manually "beautifying" the code is a pain.

joes-mama avatar May 31 '23 11:05 joes-mama

Sounds like our code incorrectly migrates the old settings. Try changing some setting on and off, it should help.

tophf avatar May 31 '23 11:05 tophf

Sounds like our code incorrectly migrates the old settings. Try changing some setting on and off, it should help.

Wow your quick! Any settings specifically? I have already tried "on-off-ing" the editor settings in the sidebar and all the beautify settings. I can tell you that turning on "Indent @-moz-document" avoids this issue.

joes-mama avatar May 31 '23 11:05 joes-mama

Try toggling any setting and then toggle it back.

tophf avatar May 31 '23 12:05 tophf

Try toggling any setting and then toggle it back.

Definitely doesn't fix this issue; I've tried this multiple times. It just changes the code to look like the first photo (indented though) when toggled on, and then back to the second when toggled off. Thanks for the suggestion anyway.

joes-mama avatar Jun 08 '23 09:06 joes-mama

In that case I don't know what is the problem. Could you run prefs.get('editor.beautify') in devtools console of the editor and paste the output here?

tophf avatar Jun 08 '23 09:06 tophf

prefs.get('editor.beautify') Object { selector_separator_newline: false, newline_before_open_brace: false, newline_after_open_brace: true, newline_between_properties: true, newline_before_close_brace: true, newline_between_rules: true, preserve_newlines: false, end_with_newline: false, indent_conditional: true, indent_mozdoc: false, … }

I hope I have copied the right thing. And, sorry for the late replies by the way.

joes-mama avatar Jun 12 '23 12:06 joes-mama

It's an incomplete preview of the object. Click it to expand fully so it shows the contents of ....

tophf avatar Jun 12 '23 12:06 tophf

image

joes-mama avatar Jun 12 '23 14:06 joes-mama

There's no internal problem with your settings, and I'm seeing the bug now with my own settings too, gonna investigate...

tophf avatar Jun 12 '23 15:06 tophf

Thanks heaps

joes-mama avatar Jun 12 '23 22:06 joes-mama

@tophf Hey. Any update on this?

joes-mama avatar Jun 26 '23 09:06 joes-mama

It's not as trivial as I hoped because I also want to support the CSS nesting syntax. I'm contemplating rewriting the beautifier or at least reusing our existing code from one of the linters...

tophf avatar Jun 28 '23 16:06 tophf

Alright, appreciate it.

joes-mama avatar Jun 30 '23 03:06 joes-mama

Just wanted to say that this is still happening for me

aaronliu0130 avatar Jan 31 '24 20:01 aaronliu0130

Yeah, @tophf any plans on when this might be fixed?

joes-mama avatar Mar 21 '24 03:03 joes-mama