vim-smartinput icon indicating copy to clipboard operation
vim-smartinput copied to clipboard

Curly brace closure in SASS/SCSS works poorly

Open kendagriff opened this issue 12 years ago • 6 comments

Maybe I'm doing something wrong, but here's how it works out when trying to do nested braces in SASS:

body {
   div {
}
}

Instead of indenting the inner closing brace, it shifts it all the way over to left. Thoughts?

kendagriff avatar Apr 03 '12 12:04 kendagriff

Thank you for the feedback. I'll investigate it later.

kana avatar Apr 04 '12 02:04 kana

I've investigated the problem. But I'm confused about your question.

First, the example you given seems to be written in SCSS, not SASS. Because SASS use indentation instead of {...} to denote a block of properties. Did you really mean that there is a problem to edit SASS file with vim-smartinput?

Second, even if you actually meant SCSS, SCSS is correctly indented with or without vim-smartinput. So that I suspect that you used wrong filetype to edit SCSS file (such as .sass).

kana avatar Apr 04 '12 08:04 kana

Yeah, sorry for confusing the issue by even mentioning SASS. SCSS is the syntax I'm using.

SCSS is correctly indented with or without vim-smartinput.

I'm not really sure where my problem is, then. When I remove vim-smartinput, the SCSS files indent correctly, however, they do not close the curly braces automatically. When I add vim-smartinput, the curly braces close (like you'd expect), but the closing brace is not indented.

On the first level selector, it works fine:

body {
  *cursor here
}

But for any nested selector:

body {
  head {
    *cursor here
}
}

When I run :set filetype?, the result is indeed scss, so I think I'm good there. And I'm running Vim 7.3 with SCSS support...

kendagriff avatar Apr 04 '12 14:04 kendagriff

Okay. I'll reinvestigate it later.

kana avatar Apr 04 '12 15:04 kana

Thanks, I appreciate it!

kendagriff avatar Apr 04 '12 16:04 kendagriff

I can confirm this. I'm a new user of the plugin and just had a look through the issues here to see what I might run into. SCSS is indeed behaving the way @kendagriff is describing.

teddyzetterlund avatar Oct 11 '12 05:10 teddyzetterlund