Skip to content

Pressing Tab key causes unwanted code changes #68873

@levicki

Description

@levicki

Please consider this code:

image

Pressing the Tab key while the cursor is positioned immediately after the Class property results in IDE making this change:

image

I have removed all the code snippets for C#:

image

I have chosen to never include snippets:

image

But the IDE refuses to allow me to insert a tab character after the word Class, and instead performs this nonsensical change resulting in broken code.

Furthermore, copying Tab character from elsewhere in IDE and pasting it after the word Class results in this change:

image

That's right, the code is reformatted (which I didn't ask for) and Tab character is not inserted (which I did ask for).

If at this point I hit Ctrl+Z, the alignment will be restored and the Tab character will appear to the right of the word Class.

Maybe I am missing some additional IDE setting which can disable this madness, but even so this is a seriously f*cked up default behavior and it cannot but remind me of Charles Petzold saying back in 2005 how Ctrl+Z is his most used key in Visual Studio and Word -- I am literally spending more time fighting the IDE than coding because of issues like this.

I am observing this problem in Visual Studio 2022 version 17.6.4.

Please fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0 - BacklogArea-IDEhelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions