Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect spacing when inserting new line after multiple folded blocks of vode #40926

Closed
GammaGames opened this issue Dec 29, 2017 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-folding Editor code folding issues editor-multicursor Editor multiple cursor issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@GammaGames
Copy link

  • VSCode Version: 1.19.1
  • OS Version: Windows 10.0.16299 Build 16299

Steps to Reproduce:

  1. Copy this code:
foo = {
    foobar: function(){
        this.foobar();
    },
    foobar: function(){
        this.foobar();
    },
    foobar: function(){
        this.foobar();
    },
    foobar: function(){
        this.foobar();
    },
    foobar: function(){
        this.foobar();
    },
}
  1. Collapse all functions
  2. Use alt+click to select the space to the right of the closing bracket
  3. Press enter/paste text with a new line in it

Reproduces without extensions: Yes

it seems like its effected by any insertions containing new line . The display is correct if you change tabs and go back it looks as expected. The issue appears to be across more than one language, it is still present in this code:

<?php
    class Foo
    {
        public function bar() {
            $this->foobar();
        }
        public function bar() {
            $this->foobar();
        }
        public function bar() {
            $this->foobar();
        }
        public function bar() {
            $this->foobar();
        }
        public function bar() {
            $this->foobar();
        }
    }

Expected:
image
Actual:
image

@vscodebot vscodebot bot added the editor label Dec 29, 2017
@Tyriar Tyriar added editor-autoindent Editor auto indentation issues editor-multicursor Editor multiple cursor issues labels Jan 2, 2018
@rebornix rebornix added the bug Issue identified by VS Code Team member as probable bug label Sep 6, 2018
@rebornix rebornix added editor-folding Editor code folding issues and removed editor-autoindent Editor auto indentation issues labels Nov 3, 2020
@rebornix rebornix assigned aeschli and unassigned rebornix Nov 3, 2020
@aeschli
Copy link
Contributor

aeschli commented Nov 3, 2020

I can reproduce. Looks like a bug updating the view model. When the view model is updated with the new lines it seems to refer to hidden lines that have already the updated locations.
image

Besides the wrong cursor position, a new hidden region is created, without folding indicators. See line 13.

image

@aeschli aeschli assigned alexdima and unassigned aeschli Nov 3, 2020
@alexdima alexdima added this to the January 2021 milestone Dec 30, 2020
@mjbvz mjbvz added the verified Verification succeeded label Jan 27, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug editor-folding Editor code folding issues editor-multicursor Editor multiple cursor issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants
@rebornix @Tyriar @alexdima @aeschli @GammaGames @mjbvz and others