-
Notifications
You must be signed in to change notification settings - Fork 352
Chained methods are indented #514
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
Comments
HI, <Abc className="xxx" data={this.props.data}>
<Def
className="yay"
/>
</Abc> instead, when indent Component property, it will be <Abc className="xxx" data={this.props.data}>
<Def
className="yay" />
</Abc> when I use 8c56957, it no problem |
This should all be fixed in |
What config options needs to be set to not indent chained funcitons? |
https://github.com/pangloss/vim-javascript#indentation-specific . |
For anyone searching and finding this issue, I was able to disable indenting chained methods with this new config variable: let g:javascript_opfirst = 1 |
the reason i removed the documentation for them^^. probably a better idea to change that to |
@bounceme I tried using |
true, that is a terrible suggestion, |
Anyway, this issue is about chained functions, so suggesting a change to an option which removes indenting for all operators isn't helpful. |
just to clarify, this is a regex option |
Ah ok, thank you for clarifying. In that case, which indentation option would apply to chained functions? When I check the help from the link above, the |
I removed the options from the readme as they are very complicated to get right. just remove the dots in these regexes https://github.com/pangloss/vim-javascript/blob/develop/indent/javascript.vim#L70 |
Thanks for your patience with this issue. I tried removing the dots by setting these in my .vimrc: let g:javascript_opfirst = '\%([<>,?^%|*&]\|\/[^/*]\|\([-:+]\)\1\@!\|=>\@!\|in\%(stanceof\)\=\>\)'
let g:javascript_continuation = '\%([<=,?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<in\%(stanceof\)\=\)' However, it's still indenting chained functions. |
those work for me, maybe a issue with your vimrc? |
Hi there,
It looks like PR #385 broke the way I'm used to write chained function calls:
Instead, it's now forcing an indent:
Is there an easy way to bring back the old behavior without checking out an old commit before the PR?
Thanks!
The text was updated successfully, but these errors were encountered: