leafOfTree / vim-vue-plugin

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

I wanted something that folds vue files properly. The folds are improper. #34

Closed aasutossh closed 2 years ago

aasutossh commented 3 years ago

I am using the config https://github.com/leafOfTree/vim-vue-plugin#example.

Currently the <template> don't get folded. It folds the script and style tag but it's weird. image image

leafOfTree commented 3 years ago

Hi, thanks for your feedback. I'm sorry that I couldn't respond earlier.

I tried a file with the example config and then toggled folding with zM and zR. It looks like below, which looks proper to me. Can you try it and see if it works for you, too? Or can you share a minimal example file that folds improperly?

<template>
  <p>{{ greeting }}</p>
</template>

<script>
export default {
  data: function () {
    return {
      greeting: 'Hello'
    };
  },
};
</script>

<style scoped>
p {
  font-size: 2em;
  text-align: center;
  background: rgb(0, 0, 0, 0.7);
}
</style>
Screen Shot 2021-06-15 at 11 05 52 AM
leafOfTree commented 3 years ago

Please note that you can verify it with a minimal confg like

  let g:vim_vue_plugin_config = { 
        \'syntax': {
        \   'template': ['html'],
        \   'script': ['javascript'],
        \   'style': ['css'],
        \},
        \'foldexpr': 1,
        \}
leafOfTree commented 2 years ago

I'm closing this issue. Feel free to reopen It if you still have an issue with the latest version.

aasutossh commented 2 years ago

hi, could you look at this? https://youtu.be/o7VmFe0UbFA

I tried folding and unfolding at multiple places, it doesn't fold just one tag, but rather folds the whole template section. I was supposed to be able to fold and unfold a single tag, wasn't I?

aasutossh commented 2 years ago

I was supposed to be able to fold and unfold a single tag, wasn't I?

Nevermind, it's working as expected now.