NV / chrome-devtools-autosave

Auto-saving CSS and JavaScript changes from the Chrome Developer Tools
MIT License
1.04k stars 89 forks source link

CSS format can get messed up sometimes #65

Closed trymbill closed 8 years ago

trymbill commented 12 years ago

Hi there,

I'm trying to incorporate devtools autosave in my workflow and I'm liking it a lot. One of the things I'm having a bit of an issue with is getting auto save to preserve the formatting of my CSS files. I might add some attributes and values to a clause and the outcome is sometimes like this:

.class {
    overflow: hidden; 

height: 15px;
margin: 3px;

    background-color: #eff2f7;
    color: #000;
    cursor: default;
    }

My OCD goes nuts when I see this. Maybe this is a bug, I don't know, but shouldn't auto save just follow the indentation of the previous line?

Thanks.

trymbill commented 12 years ago

Another issue is with the ending bracket / }. From time to time it seems to loose its indentation. I've recently started formatting my CSS in a way that requires the ending bracket to be correctly indented, like so:

.class {
    color: #fff;
    }

    .class .child-class {
        color: #000;
        }

        .class .child-class .infant-class {
            color: #c00;
            }

You get my point :) Autosave (or dev tools) messes this up from time to time, removing the indentation of my ending bracket. It's a minor issue, but it's still a blocker for me and my OCD :-/

NV commented 12 years ago

Chrome DevTools guesses an indent based on closest lines. You should report the cases when it isn’t to Chrome DevTools mailing list.