Skip to content

Incorrect format on paste for blank line inside js function #29896

Closed

Description

@mjbvz
  • VSCode Version: Code - Insiders 1.14.0-insider (9541932, 2017-06-29T05:07:31.424Z)
  • OS Version: Darwin x64 16.6.0

Steps to Reproduce:

  1. Enable format on paste
  2. Copy the js code:
function abc() {

}
abc

note that the blank line has no whitespace on it. It is empty

  1. Paste the code into a blank js file

Expected
Retained formatting:

function abc() {

}
abc

Actual
Code is indented

function abc() {
  
  }
  abc

Activity

  1. added
    editor-autoindent
    javascript
    on Jun 29, 2017
  2. added
    bug
    on Nov 14, 2017
  3. added a commit that references this issue on Nov 28, 2017
  4. rebornix commented on Nov 28, 2017

    @rebornix
    Contributor

    #36294, #29896, #38833 share the same root cause: empty lines are not handled gracefully. I pushed a fix which makes this specific case work but it may not work for all cases ;)

  5. locked and limited conversation to collaborators on Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugeditor-autoindentjavascript

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions