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

Add a setting to prevent extra newline between brackets #34861

Closed
jkyeung opened this issue Sep 22, 2017 · 6 comments
Closed

Add a setting to prevent extra newline between brackets #34861

jkyeung opened this issue Sep 22, 2017 · 6 comments
Labels
editor-bracket-matching Editor brace matching feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code
Milestone

Comments

@jkyeung
Copy link

jkyeung commented Sep 22, 2017

Pressing Enter while the cursor is between empty brackets results in an extra newline before the closing bracket. For example, using | to represent the cursor, if we press Enter here

foo = [|]

we get

foo = [
    |
]

I'd love a setting which allows me to get this instead:

foo = [
    |]

In case it's not clear, I'm thinking about all kinds of brackets, not just square brackets. Like, whichever ones editor.autoClosingBrackets handles.

@vscodebot vscodebot bot added editor editor-bracket-matching Editor brace matching labels Sep 22, 2017
@alexdima alexdima added feature-request Request for new features or functionality editor-core Editor basic functionality labels Sep 25, 2017
@alexdima alexdima added this to the Backlog milestone Sep 25, 2017
@alexdima alexdima removed the editor label Nov 23, 2017
@alexdima alexdima removed the editor-core Editor basic functionality label Apr 17, 2018
@alexdima alexdima removed their assignment Apr 17, 2018
@alexdima alexdima changed the title Feature request: Add a setting to prevent extra newline between brackets Add a setting to prevent extra newline between brackets Nov 14, 2018
@alexdima alexdima added the *out-of-scope Posted issue is not in scope of VS Code label Oct 16, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 16, 2019

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@vscodebot vscodebot bot closed this as completed Oct 16, 2019
@imax9000
Copy link

Could you please reconsider? This auto-newline bullshit is easily in my top 10 of most infuriating text editor misfeatures.

@ygqygq2
Copy link

ygqygq2 commented Sep 7, 2022

setttings.json add "editor.language.brackets": [], can do what you say.

@jkyeung
Copy link
Author

jkyeung commented Sep 13, 2022

setttings.json add "editor.language.brackets": [], can do what you say.

@ygqygq2 - No, it can't. You have misunderstood my issue.

@imax9000 @foreverstupid @tinynow @JuliusPunhal - Thank you for upvoting this issue. It's always nice to know that I'm not the only one! Especially for coming back after three years and still expressing support.

As far as I'm aware, there is still no setting within VS Code that handles this. However, for those of you who program in Python (which includes me), the Python Indent extension does have a setting for this! (I just discovered this enhancement today, though it's actually been around for over two years now.) Which I guess means there's still no relief for other programming languages without a corresponding extension; but at least it offers a little hope, and perhaps even a roadmap for those who are motivated enough to take on writing their own extension.

@zimtsui
Copy link

zimtsui commented Oct 24, 2022

This option is very useful for LISP user. Why is this issue closed😳

@zimtsui
Copy link

zimtsui commented Oct 24, 2022

Ok I found a setting

{
    "editor.autoIndent": "keep"
}

It's preset by the language extension whether it should add an extra new line. But VS Code can ignore that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-bracket-matching Editor brace matching feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

5 participants