leafOfTree/vim-vue-plugin

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

StephenOrJames opened this issue · 2 comments

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:

  • <template>...</template> <style>...</style>, i.e. when there simply is no <script> section
  • <script>...</script> <template>...</template> <style>...</style>, i.e. when the <script> section comes before the <template> section
  • <template>...</template> <style>...</style> <script>...</script>, i.e. when the <script> section comes after the <style> section (against the recommendation in the Vue style guide)

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>

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

Thanks, it seems to work as expected now!