jwalton512 / vim-blade

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

Inline blade conditionals #17

Closed tremby closed 10 years ago

tremby commented 10 years ago

You must hate me by now!

@if ($a == 'b') <h1>Same!</h1> @endif
<div>
    <h2 class="big-heading {{{ $h1Class }}} @if ($a == 'b') same-class @endif" @if ($a == 'b') data-extra-attr="same" @endif>
        H2 content
    </h2>
</div>

screen shot 2014-03-12 at 3 18 30 pm

The first line illustrates that the plugin currently doesn't highlight inline blade conditionals properly.

The rest shows that conditionals within an HTML attribute aren't recognized at all, and then that conditionals inside an HTML tag are recognized but don't reset the context properly, both inside the conditional (same issue as line 1 perhaps) and after the conditional.

The wrongly highlighted </h2> tag looks like an issue we've seen before, but I imagine it'll be fine once the rest of this ticket is seen to.

jwalton512 commented 10 years ago

Don't hate you at all. I appreciate finding the bugs. I'm brand new to Vimscript so I know there are going to be bugs

On Wednesday, March 12, 2014, Bart Nagel notifications@github.com wrote:

You must hate me by now!

@if ($a == 'b')

Same!

@endif

H2 content

[image: screen shot 2014-03-12 at 3 18 30 pm]https://f.cloud.github.com/assets/199635/2403878/52baf502-aa34-11e3-9173-8749e076d7b5.png

The first line illustrates that the plugin currently doesn't highlight inline blade conditionals properly.

The rest shows that conditionals within an HTML attribute aren't recognized at all, and then that conditionals inside an HTML tag are recognized but don't reset the context properly, both inside the conditional (same issue as line 1 perhaps) and after the conditional.

The wrongly highlighted tag looks like an issue we've seen before, but I imagine it'll be fine once the rest of this ticket is seen to.

Reply to this email directly or view it on GitHubhttps://github.com/xsbeats/vim-blade/issues/17 .

tremby commented 10 years ago

Looks perfect -- thanks!