-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Closed
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugc++C++ support issuesC++ support issueseditor-autoindentEditor auto indentation issuesEditor auto indentation issueseditor-clipboardEditor clipboard issuesEditor clipboard issuesinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code InsidersverifiedVerification succeededVerification succeeded
Milestone
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: code-1.98.1-1741624570.el8.x86_64
- OS Version: Red Hat Enterprise Linux release 9.5 (Plow)
Steps to Reproduce:
if (foobar)<enter>Cursor is now at the same indentation as if, not one step indented.
or
if (foobar)
do_something();Put the cursor at the start of do_something(); and paste a line. End result:
if (foobar)
pasted();
do_something();#209802 seems to discuss the same issue, but for JavaScript/TypeScript. And in that language things seem to behave much more sane with the current version of vscode.
As noted on that issue, it's important to also consider the style:
if (foobar)
{
do_something();
}The solution implemented for JavaScript is that you get an automatic indentation after if (foobar), then it un-indents when you type the {. The same behaviour would be ideal for C/C++ (and likely all C inspired languages).
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugc++C++ support issuesC++ support issueseditor-autoindentEditor auto indentation issuesEditor auto indentation issueseditor-clipboardEditor clipboard issuesEditor clipboard issuesinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code InsidersverifiedVerification succeededVerification succeeded