Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
joes-mama opened this issue May 31, 2023 · 15 comments
Open

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

joes-mama opened this issue May 31, 2023 · 15 comments

Comments

@joes-mama
Copy link

joes-mama commented May 31, 2023

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.

@tophf
Copy link
Member

tophf commented May 31, 2023

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

@joes-mama
Copy link
Author

joes-mama commented May 31, 2023

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.

@tophf
Copy link
Member

tophf commented May 31, 2023

Try toggling any setting and then toggle it back.

@joes-mama joes-mama changed the title [Bug] Indenting with "Indent @-moz-document" unchecked [Bug] Indenting when "Indent @-moz-document" unchecked Jun 8, 2023
@joes-mama
Copy link
Author

joes-mama commented Jun 8, 2023

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.

@tophf
Copy link
Member

tophf commented Jun 8, 2023

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?

@joes-mama
Copy link
Author

joes-mama commented Jun 12, 2023

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.

@tophf
Copy link
Member

tophf commented Jun 12, 2023

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

@joes-mama
Copy link
Author

image

@tophf
Copy link
Member

tophf commented Jun 12, 2023

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

@joes-mama
Copy link
Author

Thanks heaps

@joes-mama
Copy link
Author

@tophf Hey. Any update on this?

@tophf
Copy link
Member

tophf commented Jun 28, 2023

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...

@joes-mama
Copy link
Author

Alright, appreciate it.

@aaronliu0130
Copy link

Just wanted to say that this is still happening for me

@joes-mama
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants