Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Embedded JSX in parens breaks indentation #411
Comments
wd
commented
Jul 23, 2017
|
It seems I got the same issue:
Line 3 shouldn't indent. If I delete the '()=>', the indent works ok. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
benzitohhh commentedApr 6, 2017
•
edited
Hi there,
in js2-jsx-mode (and also rjsx-mode)...
when embedded JSX is wrapped in parens, the indentation breaks.
Some examples:
It seems like when previous line has embedded JSX in parens,
"indentation-type" is interpretted as "nil" (should be "nth")
i.e. see
js-jsx-indent-lineandjs--jsx-indented-element-p(injs.el)I get this behaviour in both Emacs 25.1 and also Emacs 25.1-2
Obviously one workaround would be to not use parens. But unfortunately I need to use parens to make certain rjsx functinality work (i.e. see felipeochoa/rjsx-mode#27 (comment) and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24896#20)
Anyways any ideas would be really appreciated - thanks!