leafOfTree / vim-vue-plugin

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

No highlighting with "wrong" indentation #25

Closed suruaku closed 3 years ago

suruaku commented 3 years ago

As you can see in the screenshots highlighting wasn't working when I had my indentation a bit of. I have g:vim_vue_plugin_highlight_vue_keyword=1 in my vimrc.

Berofe: image

After: image

leafOfTree commented 3 years ago

Thanks for the feedback. I checked the code and realised that the highlighting only effects for the keyword with correct indentation. It is to prevent highlighting when the inner object uses the keyword as key.

export default {
  data: {
    data: {
    }
  },
  computed: {
    name: {
    }
  }
}

I wonder if you don't have the nested cases and have to deal with some "wrong" indentation codes, maybe we can add an option to toggle it.

suruaku commented 3 years ago

Okay, I get it. Could it be so that only first data object is highlighted? Since it's always the first one.

Now while testing, I also noticed that if you use async with for example mounted() it doesn't get highlighted either.

With async: image

Without async: image

leafOfTree commented 3 years ago

Hi, I have to say it seems not easy to highlight only the first data object.

The async has been resolved with b8e23259e2453b3d56171c1d59e855e18c415acd and 559d93c6ba6a857696f7849baca0d2b9b0dfd0f8 . Please update and see if it works.

suruaku commented 3 years ago

Okay, it's not a huge issue so maybe it's better to leave it as it is. (I have no experience with vim extensions and those regex patterns look a bit scary :D)

Async works now, thanks!

leafOfTree commented 3 years ago

You're welcome. I'll close this issue. Feel free to open another issue if you may have any problem with it.