rainbow icon indicating copy to clipboard operation
rainbow copied to clipboard

Not working for Javascript functions

Open SethArchambault opened this issue 8 years ago • 4 comments

Simply parenthesis within functions are not working. An example: ` function() searchUpdated{ join(elements.results, [ join(opt(make('div'),{id:matching_officer.id }), [ text(matching_officer.rank + ' ' + matching_officer.first_name + ' '), text(matching_officer.last_name), image, join(make('div'), [join(opt(event(make('a'), 'click', function(e){e.preventDefault(); elements['review_'+e.target.officer.id].style.maxHeight = '500px'; console.log("clicked review", e.target.officer.id);}, false), {officer: matching_officer, className: 'review-a', href:"#"}), [text("review")])]), save('review_'+matching_officer.id, join(opt(make('div'),{className:'slide-down'}), [ text('Review'), make('textarea'), join(opt(make('div'),{className:'clear'}),[ join(opt(make('div'),{className:'left'}), [join(event(opt(make('a'),{officer:matching_officer}), 'click', function(e){ e.preventDefault(); console.log(e.target); elements['done_'+e.target.officer.id].style.maxHeight = '500px'; console.log('good clicked');}, false),[text("Good")])]), join(opt(make('div'),{className:'left'}), [join(event(opt(make('a'),{officer:matching_officer}), 'click', function(e){ e.preventDefault(); elements['done_'+e.target.officer.id].style.maxHeight = '500px';

console.log('bad clicked');}, false),[text("Bad")])]), ]), save('done_'+matching_officer.id, join(opt(make('div'), {className:'slide-down'}), [text('Thanks for your review.')])) `

Nothing get's highlighted here, but is highlighted here:

join(g('app'), [ join(opt(make('div'), { className:'title' }), [ text('Cop Rate') ]), join(opt(make('div'), { className:'subtitle' }), [ text('It\'s like YELP For police.. or something') ]), opt(make('div'), {className:'alert alert-info', role:'alert'}), opt(make('div'), {className:'alert alert-danger', role:'alert'}), opt(make('input'), {className:'search-box', type:'text', name:'search', onkeyup: searchUpdated, placeholder: 'Search' }), save('results', make('div')) ] );

So right now this is unusable.

I use very few other plugins:

  • syntastic
  • vim-colors-solarized
  • vim-javascript

I'm using vim from command line (iterm) on a mac

SethArchambault avatar Jul 26 '17 14:07 SethArchambault

Ah! I can confirm vim-javascript is the culprit!

Hmm.. Anyone know of a javascript syntax highlighting plugin that doesn't conflict with this? Or how do I make them not conflict? Can I prioritize the coloring somehow?

SethArchambault avatar Jul 26 '17 14:07 SethArchambault

+1, having the same problem and disabling vim-javascript "fixes" it

Seybo avatar Aug 28 '17 11:08 Seybo

There was similar problem in php and it was solved: https://github.com/luochen1990/rainbow/issues/13 there is another similar issue: https://github.com/luochen1990/rainbow/issues/73

luochen1990 avatar Oct 17 '17 10:10 luochen1990

The same problem

azat-io avatar Aug 10 '19 14:08 azat-io