Skip to content
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

Parentheses and cr, need to add additional indentation #442

Closed
ghost opened this issue May 4, 2021 · 3 comments
Closed

Parentheses and cr, need to add additional indentation #442

ghost opened this issue May 4, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented May 4, 2021

I'm using coc-pairs - which adds additional pair automatically, and because of it i'm using cr, instead of <cr>)O combination - which works, but that's not a point. This must be a default behavior.

Wrong behavior:

fn some fn(<cr>)
fn some_fn(
    x: i64
    ) <--- incorrect indentation

How to make like that:

fn some fn(<cr>)
fn some_fn(
    x: i64
) <--- CORRECT INDENTATION

Current options:

set cinoptions=L0,(s,Ws,J1,j1,m1
set indentkeys=0{,0},!^F,o,O,0[,0],0(,0)
@ghost ghost closed this as completed May 19, 2021
@yorickpeterse
Copy link

@login224444 Did you figure out how to make this work?

@ghost
Copy link
Author

ghost commented May 20, 2021

@login224444 Did you figure out how to make this work?

Nope. I've considered just not to use automatic pairs. But problem is - automatic macros' parenetheses with autocompletion. Because with function i can disable it with rust-analyzer's setting, but macro - not. And it's just kind of annoying, because of inconsistency experience.

@yorickpeterse
Copy link

@login224444 Ah, that's a bummer. I have the same problem (#442). I did find you can sort of work around it by having <cr> also run =ko. This however requires hacking whatever pairs plugin you use (here's an example using nvim-autopairs).

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant