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

Pressing tab with a selection in JavaScript code window deletes selection #3026

Closed
PeterAronZentai opened this issue Feb 15, 2016 · 10 comments
Closed

Comments

@PeterAronZentai
Copy link

VSCode 10.8, OSX El Capitan, MBP
Given the following scenario:
image

Pressing tab now produces this:
image

The undo buffer is empty.

Potential regression in 0.10.8, this feature worked fine in 0.10.7

UPDATE: this behavior is not predictable. If there are tab characters in the selection, or tab has been used already in the page other places, then it looks like working, but then again, not always.

Please consider this rather serious, as it can actually cause loss of code - if you have unsaved changes, since you cant undo.

@MystK
Copy link

MystK commented Feb 15, 2016

Hi there, to verify the steps to reproduce, you have the following code:


console.log(a)
console.log(b)

var a = function a() { }

function b() { }

The below part is highlighted:


var a = function a() { }

function b() { }

You press tab and then the highlighted code turns to:
}

The undo button does not return you back to your original code. Is this correct?

@PeterAronZentai
Copy link
Author

precise, yes.

@MystK
Copy link

MystK commented Feb 15, 2016

Could you also include your User and Workspace JSON settings, please? :)

@PeterAronZentai
Copy link
Author

Workspace settings is an empty hash. {}.
User settings below:

// Place your settings in this file to overwrite the default settings
{
    "update.channel": "insiders",
    "editor.insertSpaces": true,
    "editor.tabSize": 2,
    "editor.renderWhitespace": true,
    "files.trimTrailingWhitespace": true
}

@ElChupacabra26
Copy link

Same exact issue here, history state is lost (and so is the code 😱). Like PeterAronZentai said, the characters that show up are unpredictable.

User settings:

// Place your settings in this file to overwrite the default settings
{
    "editor.renderWhitespace": true,
    "files.trimTrailingWhitespace": true
}

@PeterAronZentai
Copy link
Author

@ElChupacabra26 also on OS X? I wonder how it did not came up earlier - considering how frequent this use case might be.

@ElChupacabra26
Copy link

@PeterAronZentai Yep, I'm on Yosemite. I was glad to see I'm not the only one having this problem

@egamma
Copy link
Member

egamma commented Feb 15, 2016

This looks like a duplicate of #2829, work arounds are described in this comment.
#2829 (comment).

Please confirm whether this issue is indeed a dupe

@PeterAronZentai
Copy link
Author

It is indeed a dupe. I am closing this now.

@PeterAronZentai
Copy link
Author

@egamma workaround works perfectly, thanks for the pointer. sorry for the wasted cycles.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants