Closed tuckergordon closed 2 years ago
It looks like the behavior of the auto closing braces and parentheses does not match that of the brackets.
Consider the following options:
let options = { indentOn: /[{\\([]$/, // indent on {, (, and [ addClosing: true }
If I have this code in my editor
{ "a": 1, "b": {} }
then place my cursor inside the {} and press return, it results in this:
{}
{ "a": 1, "b": { } }
which is expected. However, following a similar procedure with braces or parentheses results in this:
{ "a": 1, "b": [ ] }
I would expect that, because braces and parentheses are included in the behaivor of addClosing, that they would indent in the same way as braces:
addClosing
Fixed! Now there is a separate regexp to test which lines to move on:
indentOn: /[({\[]$/, moveToNewLine: /^[)}\]]/,
It looks like the behavior of the auto closing braces and parentheses does not match that of the brackets.
Consider the following options:
If I have this code in my editor
then place my cursor inside the
{}
and press return, it results in this:which is expected. However, following a similar procedure with braces or parentheses results in this:
I would expect that, because braces and parentheses are included in the behaivor of
addClosing
, that they would indent in the same way as braces: