Closed mwpowellhtx closed 3 years ago
@mwpowellhtx What programming language are you using? Are those brackets present in the file when the file is opened or were they automatically-inserted when typing [
?
@alexdima SQF
. Concerning the second question, I'm not positive, but I don't think it matters either way.
For overtyping ]
, we keep track if the ]
was automatically inserted when typing [
. Pressing backspace does not look at that, and perhaps it should, similar to overtyping.
There is now a new editor option, editor.autoClosingDelete
which is auto
by default, which means it will delete closing characters only if those characters were automatically inserted by the editor recently. The other options are always
which was the current behavior until now, and never
which means to never delete closing characters. This is now consistent with editor.atuoClosingOvertype
.
@alexdima And by "now" some idea as to which version? Thanks, and good to know, thank you.
next insiders / stable 1.55.x
Perfect, thank you, sir(s).
To verify:
[|]
, and press backspace. The ]
will not be auto-deleted because it was not auto-inserted.[
which will insert ]
and press backspace. The ]
will be auto-deleted because it was auto-inserted.editor.autoClosingDelete
can be configured to always
or never
to influence this behavior, similar to editor.autoClosingOvertype
.Thanks. 90% positive that any pair will work, AFAIK, I just chose square brackets, in this instance, []
. i.e. ()
, {}
, ""
, ''
, etc.
This works great -> verified. However I found one case of auto unexpected auto closing behavior. It is already happening in stable however, filled this issue https://github.com/microsoft/vscode/issues/119612
There is now a new editor option,
editor.autoClosingDelete
which isauto
by default, which means it will delete closing characters only if those characters were automatically inserted by the editor recently. The other options arealways
which was the current behavior until now, andnever
which means to never delete closing characters. This is now consistent witheditor.atuoClosingOvertype
.
I need to point out that this change, which I consider a 'breaking' change, is not mentioned anywhere in the latest release notes: https://code.visualstudio.com/updates/v1_55. I got here by searching for 'autoClosingDelete' in the issues page, a config option which I stumbled upon by chance in the settings page while trying to figure out what was wrong with the editor.
@mister-glass Very sorry about this. I forgot to mention this in the release notes. I will make a PR to add a section about this.
EDIT: Done via https://github.com/microsoft/vscode-docs/pull/4466
Steps to Reproduce:
Deleting within pairs of character closures too aggressive... i.e. something like this:
Position cursor before the last closing bracket and backspace, the
[0]
only. The trailing]
gets included in that operation in error. Should not be.Does this issue occur when all extensions are disabled?: Yes/No