mxw / vim-jsx

React JSX syntax highlighting and indenting for vim.
1.59k stars 95 forks source link

Removed pragma detection and added *.jsx filetype recognition #20

Closed ruyadorno closed 10 years ago

ruyadorno commented 10 years ago

Disclaimer: I don't have any experience with vimscript.

This is a wild guess on how to implement the filetype recognition and drop the old jsx pragma support.

Feel free to accept/refuse as you will, or send some review if you think I'm close of getting it :)

:jack_o_lantern: Thanks!

VinSpee commented 10 years ago

+1

muchzill4 commented 10 years ago

:+1:

mxw commented 10 years ago

Sorry—will look at this later today!

mxw commented 10 years ago

I don't think the new React/JSX version requires the .jsx extension, so I'd rather not require it here, either. Also, I think the pragma detection is worth keeping around; it can already be configured with the g:jsx_pragma_required variable. If it's all good with you, I'll push a similar commit with a g:jsx_ext_required parameter to determine whether the extension is required. I'll default that to true, and default the pragma requirement to false.

mxw commented 10 years ago

@ruyadorno—Please let me know if the latest commit fails to address your needs.

ruyadorno commented 10 years ago

@mxw I'm trying the latest commit from master but I'm getting the following errors:

Error detected while processing ~/.vim/bundle/vim-jsx/after/syntax/javascript.vim:
line   17:
E121: Undefined variable: b:jsx_ext_found
E15: Invalid expression: g:jsx_ext_required && !b:jsx_ext_found | finish | endif
mxw commented 10 years ago

@ruyadorno—Whoops, forgot to add something. Should be fixed with another pull.

ruyadorno commented 10 years ago

:+1:

works like a charm now! thanks for the good work!

muchzill4 commented 10 years ago

@mxw Thanks!