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

Cutting/Deleting folded code affects only one line #1563

Closed
PrzemyslawKlys opened this issue Oct 6, 2018 · 9 comments
Closed

Cutting/Deleting folded code affects only one line #1563

PrzemyslawKlys opened this issue Oct 6, 2018 · 9 comments

Comments

@PrzemyslawKlys
Copy link
Contributor

Having something like this:
image

Folding it...

image

Now when you delete that line or CTRL+X it my expectation would be that it would affect whole folded section and not just highlighted line. Or am I wrong? I believe this is how it works in Visual Studio 2015+ although I've not checked recently.

@rjmholt
Copy link
Contributor

rjmholt commented Oct 8, 2018

My first thought is that this is probably something VSCode itself controls, rather than us. Maybe open an issue in https://github.com/Microsoft/vscode and see what they say?

I'll close here, since I don't think we can change this behaviour from the extension. But if it turns out we can, we can reopen.

@rjmholt rjmholt closed this as completed Oct 8, 2018
@rkeithhill
Copy link
Contributor

Hmm, I don't think so. I've deleted entire collapsed regions in TS and that is supposed to work. I think the bug is in the PS extension. @glennsarti ?

@rkeithhill rkeithhill reopened this Oct 8, 2018
@PrzemyslawKlys
Copy link
Contributor Author

PrzemyslawKlys commented Oct 8, 2018

There is same behaviour for markdown and json in 1.28 so @rjmholt may be right on this.

@rkeithhill
Copy link
Contributor

rkeithhill commented Oct 8, 2018

This might be a difference based on a new setting that doesn't show the ending }. What I do is TS is collapse a section of code and the following closing } and press delete. That deletes the entire section. I have to say that I really, really DISLIKE the current code-folding default that collapses the entire folding region to a single line - for this very reason. And I'm not seeing a setting to revert back to the old behavior well without completely reverting back to indentation-based folding. :-(

@PrzemyslawKlys
Copy link
Contributor Author

If you select it this way

image

It will work properly. So it seems you have explicitly select 2nd line start for it to copy whole section.

@rkeithhill
Copy link
Contributor

OK, I see the same behavior with the C# extension where it collapses to a single line so yeah, I guess it's a VSCode issue after all.

@glennsarti
Copy link
Contributor

I have to say that I really, really DISLIKE the current code-folding default that collapses the entire folding region to a single line

Will that be fixed by #1557 ?

@glennsarti
Copy link
Contributor

@rkeithhill ^^

@rkeithhill
Copy link
Contributor

Well, yes and no. :-) I wouldn't really mind the "collapse to single line" behavior if cut/copy/delete worked as expected. But it seems that may be a VSCode bug that we can't control. :-( Either that or the C# extension has the same folding bug. But that's a bit hard to believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants