Closed jeremija closed 8 years ago
HI, I also have this problem current (master & develop) when I write React component
<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 develop
What config options needs to be set to not indent chained funcitons?
https://github.com/pangloss/vim-javascript#indentation-specific . though see if the behaviour on develop is preferable for you first (there were some small changes with operators)
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 ''
unless you want to indent when a line starts with 1
@bounceme I tried using let g:javascript_opfirst = ''
, but it caused the indentation to continue.
true, that is a terrible suggestion, ''
matches everything.
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 cino-:
section references switch statements.
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!