Closed ixtli closed 9 years ago
I use NERDTree and can't reproduce. Will try your vimrc later.
thanks :)
I'm getting the same error. Syntax highlighting is broken when the filetype in the buffer change from javascript to something else, then back to javascript again.
Looking at syntax/javascript.vim
I see that you're short-circuiting if either b:yajs_loaded
or b:current_syntax
are set. These variables survive a buffer filetype mode change, so the rest of the script isn't run when switching back to javascript.
Thanks, this information help a lot 2015年1月27日 上午6:38 於 "Martin Øinæs Myrseth" notifications@github.com 寫道:
I'm getting the same error. Syntax highlighting is broken when the filetype in the buffer change from javascript to something else, then back to javascript again.
Looking at syntax/javascript.vim I see that you're short-circuiting if either b:yajs_loaded or b:current_syntax are set. These variables survive a buffer filetype mode change, so the rest of the script isn't run when switching back to javascript.
— Reply to this email directly or view it on GitHub https://github.com/othree/yajs.vim/issues/10#issuecomment-71553665.
The latest reversion remove the yajs_loaded part. Please try again.
A simple example of a js file with ES6 syntax, as follows:
This highlights fine normally, but if i switch between this and another file, then switch back again (say using NERDTree, Command-T, etc) it marks
import
andexport
as javascriptReserved->Error, as reported by SyntaxAttr.I realize this is difficult to debug, but let me know if there's any other relevant information I can provide. I also realize that it could be a configuration issue so my current vimrc is as follows: https://gist.github.com/ixtli/a11c1b10d9565905a4ed