dotnet/roslyn

Treat backspace as undo immediately after semi-colon insert/caret movement

オープン

#51,685 opened on 2021/03/05

 (3 件のコメント) (2 件のリアクション) (0 人の担当者)C# (4,257 件のフォーク)batch import
Area-IDEConcept-Continuous Improvementhelp wanted

Repository metrics

Stars
 (20,414 個のスター)
PR merge metrics
 (平均マージ 6d 17h) (30d で 256 merged PRs)

説明

Currently in most text editors if I type a, ;, BACKSPACE, , then in my file I get a,, which is what I intended.

In Visual Studio however, in some circumstances, say for example within an expression in C#, I don't get those characters, but instead I get the cursor moved somewhere I didn't intend, a comma at that location, and usually compile errors. As a fast typer who knows when I've hit the wrong key without looking at the screen, this makes me very angry, at least once per day.

On the assumption that an option to disable this behaviour will not be forthcoming, I think it would be the Next Best Thing™ if Roslyn could detect when I've hit backspace in this scenario, and remove any semi-colon that it has inserted, and move the cursor back to where it was. This would mean my typing flow is not interrupted, and I would cease to get angry.

In general, I think its a bad idea that pressing a standard ASCII character keyboard key with no modifier can make the cursor jump an arbitrary amount.

Yes I know about the Undo feature and keyboard shortcut.

コントリビューターガイド