vim-pug icon indicating copy to clipboard operation
vim-pug copied to clipboard

No JavaScript highligt after '-' character

Open caneta opened this issue 8 years ago • 3 comments

I cannot see any highlight if I write some JavaScript inside my pug files, for example

- var test = 'test';

Or

- 
  var obj = {
    a:1,
    b:2
  }

Is such a feature not implemented yet? Thank you.

caneta avatar Feb 22 '17 10:02 caneta

It looks like this is something that I never implemented but is actually older syntax.

digitaltoad avatar Feb 25 '17 21:02 digitaltoad

I think the one-line version of - used to work at some point, but got lost somewhere.

Here's my patch for multiline -:

syn region pugJavascriptBlock start="^\z(\s*\)-\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript

moll avatar Apr 23 '17 17:04 moll

I'm fiddling in the dark as I can't be bothered to read :help syntax, but here's my temporary patch for oneliners:

syntax region pugJavascriptLine start=/^\s*-/ end=/$/ contains=@htmlJavascript

moll avatar Apr 23 '17 17:04 moll