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

Less indenting broken #272

Closed
wmaurer opened this issue Apr 8, 2015 · 4 comments
Closed

Less indenting broken #272

wmaurer opened this issue Apr 8, 2015 · 4 comments
Assignees
Labels
Milestone

Comments

@wmaurer
Copy link

wmaurer commented Apr 8, 2015

I updated to 0.23.4 this morning, and suddenly the less indentation is broken.
'Css indent char' is set to 'Default:'
'Css indent size' is set to 'Default: 4'

However now less files are being indent by 4 tabs:

a {
                &.main-navigation {
                                width: 100px;
                }
}
@Glavin001
Copy link
Owner

Could you provide your result from running the command Beautify : Help Debug Editor

@wmaurer
Copy link
Author

wmaurer commented Apr 8, 2015

Here's the result as requested.
Thanks for your help.

# Atom Beautify - Debugging information

The following debugging information was generated by `Atom Beautify` on `Wed Apr 08 2015 20:05:07 GMT+0200 (W. Europe Summer Time)`.

---

**Platform**: win32

## Versions

**Atom Version**: 0.190.0

**Atom Beautify Version**: 0.23.4

## Original file to be beautified

**Original File Path**: `D:\Projects\github_lambdait\natel-pay\flow-test-client\public\styles\site\layout.less`

**Original File Grammar**: LESS

**Original File Contents**: 
```LESS
#header {
                margin-top: 30px;
}

h1 {
                margin-bottom: 40px;
}

#index-container {
                a {
                                width: 100%;
                }
}

.container-xs,
.container-sm,
.container-md {
                margin-right: auto;
                margin-left: auto;
                padding-left: 15px;
                padding-right: 15px;
}

@media (min-width: 768px) {
                .container-xs {
                                width: 600px;
                }
}
```

## Beautification options

**Editor Options**: 
Options from Atom Editor settings
```json
{
    "indent_size": 1,
    "indent_char": "\t",
    "indent_with_tabs": true
}
```

**Config Options**: 
Options from Atom Beautify package settings
```json
{
    "css": {
        "selector_separator_newline": true,
        "newline_between_rules": true,
        "preserve_newlines": true,
        "indent_size": 4,
        "indent_char": " "
    },
    "js": {
        "indent_size": 4,
        "indent_char": " ",
        "indent_level": 0,
        "indent_with_tabs": false,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "space_in_paren": false,
        "jslint_happy": false,
        "space_after_anon_function": false,
        "brace_style": "collapse",
        "break_chained_methods": false,
        "keep_array_indentation": false,
        "keep_function_indentation": false,
        "space_before_conditional": true,
        "eval_code": false,
        "unescape_strings": false,
        "wrap_line_length": 0,
        "end_with_newline": false
    },
    "html": {
        "htmlbeautifier_path": "",
        "indent_inner_html": false,
        "indent_size": 4,
        "indent_char": " ",
        "brace_style": "collapse",
        "indent_scripts": "normal",
        "wrap_line_length": 250,
        "wrap_attributes": "auto",
        "wrap_attributes_indent_size": 4,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "unformatted": [
            "a",
            "sub",
            "sup",
            "b",
            "i",
            "u"
        ],
        "end_with_newline": false
    },
    "sql": {
        "indent_size": 4,
        "keywords": "upper",
        "identifiers": "lower",
        "sqlformat_path": ""
    },
    "markdown": {
        "pandoc_path": "",
        "yaml_front_matter": true
    },
    "perl": {
        "perltidy_path": "perltidy",
        "perltidy_profile": ""
    },
    "php": {
        "cs_fixer_path": "",
        "fixers": "",
        "level": ""
    },
    "python": {
        "autopep8_path": "",
        "max_line_length": 79,
        "indent_size": 4,
        "ignore": [
            "E24"
        ]
    },
    "ruby": {
        "rbeautify_path": ""
    },
    "c": {
        "uncrustifyPath": "",
        "configPath": ""
    },
    "cpp": {
        "uncrustifyPath": "",
        "configPath": ""
    },
    "objectivec": {
        "uncrustifyPath": "",
        "configPath": ""
    },
    "cs": {
        "uncrustifyPath": "",
        "configPath": ""
    },
    "d": {
        "uncrustifyPath": "",
        "configPath": ""
    },
    "java": {
        "uncrustifyPath": "",
        "configPath": ""
    },
    "pawn": {
        "uncrustifyPath": "",
        "configPath": ""
    },
    "vala": {
        "uncrustifyPath": "",
        "configPath": ""
    }
}
```

**Home Options**: 
Options from `C:\Users\Wayne\.jsbeautifyrc`
```json
{}
```

**EditorConfig Options**: 
Options from [EditorConfig](http://editorconfig.org/) file
```json
{
    "end_of_line": "lf",
    "charset": "utf-8",
    "trim_trailing_whitespace": false,
    "insert_final_newline": true,
    "indent_style": "tab",
    "indent_size": "tab",
    "indent_char": "\t",
    "indent_with_tabs": true
}
```

**Project Options**: 
Options from `.jsbeautifyrc` files starting from directory `D:\Projects\github_lambdait\natel-pay\flow-test-client\public\styles\site` and going up to root
```json
[
    {},
    {},
    {},
    {},
    {},
    {},
    {}
]
```

## Logs

**Error logs**: *Not yet supported*

And here the relevant section of my config.cson:

"atom-beautify":
    _analyticsUserId: "c637319e-4f3a-44a3-b21a-57b9f79a1ad8"
    beautifyOnSave: true
    css_selector_separator_newline: true
    css_newline_between_rules: true
    css_preserve_newlines: true

@wmaurer
Copy link
Author

wmaurer commented May 4, 2015

Switching over from JS Beautify to CSSComb has solved this issue. Thanks!

@wmaurer wmaurer closed this as completed May 4, 2015
@Glavin001
Copy link
Owner

This issue is actually that you have an EditorConfig file (.editorconfig) with "indent_char": "\t" which of course makes the tab characters show up instead of spaces.
CSSComb "fixes" this because it simply ignores those configurations in Atom Beautify and uses it's own .csscomb.json file.

CSScomb is great and recommended by preferred by many users (See #209 ) so you are probably better off with it anyway. However, for future reference (if you go back to JS Beautify) this is simply an issue with your personal configuration, specifically EditorConfig in this case.

You can see above:

EditorConfig Options:
Options from EditorConfig file

{
    "end_of_line": "lf",
    "charset": "utf-8",
    "trim_trailing_whitespace": false,
    "insert_final_newline": true,
    "indent_style": "tab",
    "indent_size": "tab",
    "indent_char": "\t",
    "indent_with_tabs": true
}

Glad to hear it's all working out for you now. Thank you for your patience.

@Glavin001 Glavin001 self-assigned this May 4, 2015
@Glavin001 Glavin001 added this to the v0.26.0 milestone May 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants