Skip to content

Autoindent on paste fails when first line of clipboard is a comment #201420

Closed
@russelldavis

Description

@russelldavis

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.85.1
  • OS Version: Darwin arm64 22.6.0

Steps to Reproduce:

  1. Ensure the Editor: Auto Indent setting is set to "full"
  2. Add the following to a .js file:
// comment
const foo = 42

function bar() {

    console.log("bar")
}
  1. Copy the the first two lines to the clipboard
  2. Put the cursor on the empty line inside the bar function
  3. Paste from the clipboard

Expected: The two pasted lines should be autoindented inside the function
Actual: The lines are not auto indented, they retain their original indent of 0

This only happens when the first line being pasted is a comment.

Metadata

Metadata

Assignees

Labels

editor-autoindentEditor auto indentation issuesjavascriptJavaScript support issuesunder-discussionIssue is under discussion for relevance, priority, approach

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions