leafOfTree / vim-vue-plugin

Vim syntax and indent plugin for .vue files
The Unlicense
177 stars 9 forks source link

style section is not indented if it does not immediately follow a script section #19

Closed StephenOrJames closed 4 years ago

StephenOrJames commented 4 years ago

Hello!

I just gave this plugin a try, and must say that it seems to be great so far.

However, I've noticed that, in the case where a <style> section isn't immediately precededed by a <script> section, the <style> section will not be indented. There are 3 such cases I've tried and reproduced the issue:

In the example below, I expect text-transform: uppercase; in the <style> section to be indented 1 level, but that doesn't happen.

Actual:

<template>
  <div class="test">
    Test
  </div>
</template>

<style scoped>
.test {
text-transform: uppercase;
}
</style>

Expected:

<template>
  <div class="test">
    Test
  </div>
</template>

<style scoped>
.test {
  text-transform: uppercase;
}
</style>
leafOfTree commented 4 years ago

Thank you for trying it and reporting the bug. It's a regexp error and should be fixed now.

StephenOrJames commented 4 years ago

Thanks, it seems to work as expected now!