question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: A folded method also hides empty lines after it

See original GitHub issue
  • VSCode Version: 1.25.1
  • OS Version: Ubuntu 18.04.1 LTS

Steps to Reproduce:

  1. In a c# file (or cshtml file)
  2. Fold a method
  3. It will be folded, along with empty lines after it

Example before folding:

public void foo() {
  // some code...
}
                               // this empty line will be hidden when folding "foo()"
                               // this empty line will be hidden when folding "foo()"
                               // this empty line will be hidden when folding "foo()"
                               // this empty line will be hidden when folding "foo()"
public string Bar { get; set; }

Example after folding:

public void foo() { ...
public string Bar { get; set; }

Example of what should occur:

public void foo() { ...
                               // this empty line was not folded
                               // this empty line was not folded
                               // this empty line was not folded
                               // this empty line was not folded
public string Bar { get; set; }

I’ve marked this as a bug, rather than a request, because this is not how folding works with Visual Studio - which only folds code, not whitespace after it. And I assume you’re aiming for parity with the IDEs, at least for c# anyway.

This is a really annoying problem, because when code is folded everything is bunched up together and you can’t visually separate between them - which is why you’d use empty lines between them.

(The same problem exists for .cshtml files.)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cartermpcommented, Mar 10, 2020

This is fixed - closing.

Before fold:

image

After fold:

image
1reaction
rchandecommented, Aug 9, 2018

@lonix1 This should be fixed in our next release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug: A folded method also hides empty lines after it (#55304)
In a c# file; Fold a method; It will be folded, along with empty lines after it ... I've marked this as a...
Read more >
Including blank lines following region in fold - Stack Overflow
I'm currently attempting to improve the folding behavior of Matlab files in Vim. I have a syntax file generated and the folding behaves...
Read more >
513821 – [formatter] Blank lines at beginning of method body ...
Generally, "Blank lines" settings are meant to add blank lines if missing, not to remove existing ones if there are too many (hence...
Read more >
v3.20 on Windows not showing empty lines - meld - GitLab
Using Meld 3.20.2 Windows (current latest MSI) When diffing two files that have blank lines, those blank lines aren't shown.
Read more >
separating folds with constant amount of newlines
I'm using fold by indent. The goal is two visible blank lines between each fold (actually, after the end of a fold, since...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found