Closed elmart closed 6 years ago
aight, will implement. thanks for describing
~couldnt you just ~set cino+=w1
?
let g:javascript_indent_W_pat = '[^[:blank:]{[]'
Tried and the case ending in {
works ok.
But now I get this when only parens are used:
someFunction(
arg1,
...
)
instead of
someFunction(
arg1,
...
)
This is, the closing parens alingment is not as before.
BTW, what is the empty character class []
for, in let g:javascript_indent_W_pat = '[^[:blank:]{[]'
?
It shouldn't match anything, should it?
maybe i messed up https://github.com/pangloss/vim-javascript/pull/1112/files#diff-564c1f6e79518959361f7ad8a86f5792R90 somehow. otherwise it def shouldnt be affecting lines starting with )
. [^[:blank:]{[]
is one character class like [^[{[:blank:]]
and includes the [
character ( if you want that exception too )
[^[:blank:]{[]
is one character class like[^[{[:blank:]]
and includes the [ character ( if you want that exception too )
Ah, you're right. I didn't see the first bracket was still unclosed when reaching the third [
.
I saw you had commited to master, so I started using it again. But I'm sorry to say it seems we didn't test this enough, as I'm having all kinds of weird behaviour now. First time after installing, it seems to work ok. But once you quit vim and open it again, many strange things happen. Will produce a better error report once I come back from holidays.
no problem, will fix any issues
After your last changes in #1118, everything seems fine. Closing by now. Will reopen if something wrong detected later.
Hi again. Just a question: What would the definition for javascript_indent_W_pat
be?
I mean, now I wanted to also apply cino W when last character in line is >
, so that snippets like
array.map(item =>
item.field
)
also get the right indent.
As javascript_indent_W_pat='[^[:blank:]{[]'
was working ok for me, I thought that could be done just adding '>' in the pattern, this is, javascript_indent_W_pat='[^[:blank:]{[>]'
, but that doesn't seem to work.
So I guess I'm misinterpreting what javascript_indent_W_pat
is for. Could you explain, please?
it is for the first character, (or regex), after {
adding >
is like {>
I think you mean (
, not {
. Right?
oh, yes
I have vim-javascript installed, and this in my .vimrc:
set cinoptions+=(0,m1,)100,W1s,j1,J1
. With that, I get the desired:and
But there's one specific combination, very common in javascript, where I want the following:
while I get the following with the above config:
This is, I want to chain after
(
only if there are arguments, but making the exception if the last character is{
, in which case I want next line indented one tabstop with respecto to the enclosing context. Is that possible? I've tried myself a lot, but I can't find a way.