pangloss / vim-javascript

Vastly improved Javascript indentation and syntax support in Vim.
http://www.vim.org/scripts/script.php?script_id=4452
3.79k stars 358 forks source link

ES2015 template strings with globs patterns #527

Closed ahmedelgabri closed 8 years ago

ahmedelgabri commented 8 years ago
screen shot 2016-07-02 at 20 30 28

As you can see from the screenshot after the first pattern ./app/${appName}/assets/images/** everything after this point is highlighted as a comment which is not right. Removing ** fixes everything but it's not an option.

qcam commented 8 years ago

:+1: Yeah, same problem here

amadeus commented 8 years ago

Unfortunatly I cannot reproduce this issue:

example

Perhaps something odd is going on with the conceal characters? But still, I don't see how that could be an issue...

amadeus commented 8 years ago

Hmm, just checked with that function conceal character and still couldn't reproduce. Are you guys sure you are using the latest version?

qcam commented 8 years ago

@amadeus Yeah I'm using the latest version.

Could you try this?

export default class Thing extends Components {
  render() {
    const abc = urls.map((url) =>
      <div className={`hello${something}`}></div>
    )

    const b = 10
    const c = a + b
  }
}

It looks like this for me.

screen shot 2016-07-08 at 11 53 44
bounceme commented 8 years ago

another ? mxw/vim-jsx

amadeus commented 8 years ago

@bounceme yup, that's exactly it.

@huynhquancam you need to be using the JSX plugin in addition to ours. https://github.com/mxw/vim-jsx Also you need to ensure to :set filetype=javascript.jsx once the plugin is installed.

qcam commented 8 years ago

@amadeus @bounceme Yes it works perfectly after :set filetype=javascript.jsx

Many thanks for your support!

ahmedelgabri commented 8 years ago

For me it's not a jsx issue because my file is just JavaScript. I was using the plugin through vim-polyglot, then I disabled it and used it separately, pulled the latest version, changed color schemes, even disabled all plugins except this one and still having the same problem.

qcam commented 8 years ago

vim-polyglot user here. Maybe getting the HEAD version of vim-polyglot will fix it?

vim-polyglot is actually sync-ed with this repo.

amadeus commented 8 years ago

@ahmedelgabri so, based on your screenshot that you originally posted, and based on my attempts to reproduce, I am 99% sure that for some reason your vim is not actually sourcing and using our syntax file.

For starters, just look at the things that are highlighted in my screenshot, vs yours. Your template string example doesn't even match ${} portion which leads me to believe this isn't a bug in our script at all, but something not set up properly in your configuration. Perhaps you can post more details of how you have things set up?

ahmedelgabri commented 8 years ago

@huynhquancam I already did and still the problem presists.

@amadeus Here is my .vimrc file, also I have this for function conceal color.

I'm using iTerm2, Neovim (HEAD) & tmux. All with true color enabled.

amadeus commented 8 years ago

Oh yeah, your concealing code ruins everything. You should be using our built in concealing api, check the readme for details.

ahmedelgabri commented 8 years ago

Yes that was the problem, I forgot to remove it when I moved to vim-polygot. Thanks @amadeus