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

Arrow functions indentation with K & R style breaks #305

Open
eavdmeer opened this issue Dec 3, 2022 · 0 comments
Open

Arrow functions indentation with K & R style breaks #305

eavdmeer opened this issue Dec 3, 2022 · 0 comments

Comments

@eavdmeer
Copy link

eavdmeer commented Dec 3, 2022

Auto-indenting works fine with end-of-line braces:

fs.readFile('whatever', (err, content) => {<CR>
  // do something useful<CR>
}<CR>

However, this breaks when using K & R style:

fs.readFile('whatever', (err, content) =><CR>
  {<CR>
    // do something<CR>
  }

Indentation of the function body is initially correct, but as soon as you press the '{' key, the indentation level is incremented. Looks like this is happening due to the indentkeys including 0{. Removing it from indentkeys makes delimitMate work, but that results in this:

if (x < 2)<CR>
  {<CR>
    // more stuff<CR>
  }

Auto-indentation no longer removes the extra indentation level on the { key press.

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