-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect indentation for TSX (JSX) #138
Comments
@knpwrs , I just tested your last example with the latest version of function render() {
return (
<div>
<h1>hello</h1>
<div>
<div>
// Cursor ends up all the way back here!
</div>
</div>
</div>
);
} |
I'm getting similar issues. Especially when I spread tsx tag attributes over multiple lines (hitting always puts me at the beginning of the line with no indentation.) Bug seems to come and go though and I'm struggling to make it reproducible. Heres my .vimrc if that helps:
|
Observe: https://asciinema.org/a/42J9ciXzTLLWNTj0LOvPG3OkO
The following is the session from the above recording:
The
console.log
lines were inserted one after another by pressingo
and typing -- indentation works fine. The<h2>
lines were added by pressingo
and typing -- indentation always goes to the root level.If I have the following...
...and I press
o
on the inner-mostdiv
tag, I end up in a situation as such:This makes typing JSX really hard. In
jsx
files withpangloss/vim-javascript
indentation works just fine in the same situation: https://asciinema.org/a/f4I4gd5skmJvuhrzay3n4KnmFThe text was updated successfully, but these errors were encountered: