jwalton512 / vim-blade

Vim syntax highlighting for Blade templates.
226 stars 37 forks source link

Indentation and syntax borked in Laravel 5.5 #66

Open superDuperCyberTechno opened 7 years ago

superDuperCyberTechno commented 7 years ago

I just pulled a fresh installation of Laravel and took a look in the default welcome.blade.php file.

Hit gg V G = and ended up with the following results.

Before: image

After: image

Clearly, the indentation is all wrong and the syntax highlighting doesn't seem to recognize the new custom if-conditionals (@auth and its closing tag @endauth) - the latter seemingly being the root of the problem.

superDuperCyberTechno commented 7 years ago

Alright, the problem is with an outdated version in vim-polyglot, not this repo. I ran vim-polyglot's ./build (~/.local/share/nvim/plugged/vim-polyglot/build, running Neovim on Ubuntu) and that fixed the indentation, but not the syntax. - Bug or feature?

On a related note, will vim-blade ever be able to parse user-specified custom if-conditionals?

adriaanzon commented 7 years ago

The @auth directive only got added to the indent file. Some time ago I started working on an autoload file for specifying all directives in one place, to make it easier to add new directives. I haven't come around to finish it, though.

You can add your own directives via g:blade_custom_directives and g:blade_custom_directives_pairs, as explained in the readme, is that what you meant?

superDuperCyberTechno commented 7 years ago

I was thinking autonomously, detecting directives without having the user adding them manually. Not sure if it's possible, though...?