styled-components / vim-styled-components

Vim bundle for http://styled-components.com based javascript files.
300 stars 24 forks source link

Error thrown on indenting using with Lexima plugin #54

Closed akinsho closed 5 years ago

akinsho commented 5 years ago

Thanks for the amazing work @fleischie :heart_eyes: (plugin has been getting better and better :+1:).

I've been encountering an error using this plugin with cohama/lexima.

lexima-error

On trying to indent inside of JSX, I get the error above which I think relates to some interaction between lexima and this plugin at this line. I've tried using delimitMate instead or disabling it and it works fine with lexima removed. I'm not an expert in vimscript so not sure exactly whats going on, but the plugin is running the GetStyledIndent when I try and create an indent outside of a styled-component, which might be by design or a bug :thinking:.

I'm running Nvim 0.3.1 on Manjaro Linux, please let me know if there's any other details I can provide

fleischie commented 5 years ago

Hello @Akin909 and thank you for your kind words, I'm trying my best. :smile:

Calling GetStyledIndent is in fact by design, because it wraps a call for non-styled-components for different javascript plugins. So that is ok, I guess.

I will try to look into it, because I initially suspect a naming conflict between this and that plugin, but yeah I will have to investigate this further of course. Just be patient because holidays and stuff.

I get back to you, if I need more information. Thanks again for the issue. :bowing_man:

fleischie commented 5 years ago

Haha, I lied. :man_shrugging: I used the downtime between family obligations to look into this issue.

Would you be so kind to test out the develop branch? (Use Plug 'styled-components/vim-styled-components', { 'branch': 'develop' } if you use junegunn/vim-plug, but this depends on your plugin manager.)

The above mentioned error seems to vanish once I initialize the highlighted variable outside of its execution branch inside of the appropriate routine. So yeah... maybe it works.

Happy holidays. :v:

akinsho commented 5 years ago

@fleischie thanks for looking at it so quickly :heart_eyes: , just tested out the develop branch and I'm not seeing the error anymore :+1: :100:

fleischie commented 5 years ago

Cool. I'll merge it as soon as I'll get the chance. 🚀

fleischie commented 5 years ago

Hey @Akin909

I totally forgot I was to cut a release from the changes made in develop. I just did that now, so feel free to try out the main branch of this plugin.

I close this issue now. Feel free to open a new one, if you should have more troubles.

Thanks again for your contribution. 🙇