nex3 / sass-mode

Emacs mode for Sass

Home Page:http://sass-lang.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SASS multiply nested elements defaulting to \t

scottrabin opened this issue · comments

When attempting to indent subsequent lines of indented selectors, most work fine; however, in the example below, the nested properties for the > li selector do not highlight and throw the following error on attempting to convert to CSS:

error sass/page.sass (Line 138: Inconsistent indentation: 1 tab was used for indentation, but the rest of the document was indented using 2 spaces.)

Tabbing through each level of indentation properly highlights the properties at each level EXCEPT as nested under > li, where they default to black and throw the above error.

Here's the offending code:

#footer
  font-size: 12px
  padding: 20px 0

  h2
    color: lighten($second-color, 30%)
    font-size: 16px
    text-shadow: 1px 1px 1px #000000, 1px 1px 1px #000000

    > ul
      margin: 0-5px
      padding: 0
      list-style-type: disc

      > li
        height: 160px
        width: 110px
        display: inline-block
        vertical-align: top
        padding: 0 10px

I get this as well.
I notice that this bug is two years old, but I'm getting this with the latest version, updated from git today.

If the indentation of a rule is greater then 7 "points" away from the beginning of the line, then syntax highlighting fails and I get a similar error as described above:

error ./myfile.sass (Line 332: Inconsistent indentation: "\t    " was used for indentation, but the rest of the document was indented using 2 spaces.)

I've discovered a temporary workaround:

  • Select the problem line...
  • hit tab until the syntax highlighting appear
    (by this time, the line will typically begin at an undesired column in the buffer)
  • Position point before the line
  • Insert spaces until highlighting takes effect
  • Save file

At this point, the generated css file will apply the rule.

I'm afraid I don't quiet know enough about lisp or sass-mode to debug any further. But I hope this description might shed light on the issue.