Questions tagged [code-folding]

Code folding is a feature of some text editors that allows one to ‘fold’ (collapse/hide) and ‘unfold’ (expand/reveal) large blocks of code.

Code folding is a feature of some text editors that allows one to ‘fold’ and ‘unfold’ large blocks of code. This can be helpful to see a quick overview of a source file:

A C source file with two collapsed (‘folded’) functions, <code>greet</code> and <code>main</code>. The body of the functions are not visible.

However, folds can be expanded to work on a particular part of a file:

The same file as above, but with the definition of <code>main</code> unfolded.

In some editors, folding is indicated by a disclosure triangle in the line number area:

I lied; there are no line numbers. However, in the pane where the line numbers *would* be, there are three triangles: two to collapse the unfolded <code>greet</code> function, and another, in orange, to expand/unfold the folded <code>main</code> function.

Resources

205 questions
1
vote
0 answers

WebStorm: don't fold loops and ifs

JetBrains Helper says that: Code folding works for the keywords if/ while/ else/for/ try/ except/finally/ with in case of at least two statements. I would like to fold only functions, like in IDEA etc.
ivanjermakov
  • 1,131
  • 13
  • 24
1
vote
0 answers

Can you base code folding on symbols in vscode?

My question is about code folding in VSCODE editor. I wonder if it is possible to base code folding upon symbols defined? I have created an extension that finds all the symbols in a file to make it possible to navigate to these symbols. Now I would…
haarse
  • 39
  • 4
1
vote
1 answer

Explicitly say which conditions to fold Notepad++

I have a custom language for SQR and I'm trying to get the code folding feature to work for Notepad++. In SQR, the case of the keywords do not matter. Begin-Procedure is the same as bEgIn-ProCEdure. The same goes for the traditional if ... end-if…
Jimenemex
  • 3,104
  • 3
  • 24
  • 56
1
vote
2 answers

Code Folding multiple open lines in Notepad++

I'm attempting to create a user defined language based on code for motion capture syntax files (in Visual3D). I want to fold code based on the following syntax The open argument always looks like…
Patrick
  • 915
  • 2
  • 9
  • 26
1
vote
1 answer

Can anyone confirm if coffee-bytes works with eclipse oxygen?

The most recent version anyone has mentioned using coffee-bytes with is Eclipse Neon. Has anyone used this code-folding plugin on Eclipse Oxygen? In my efforts: I installed coffee bytes from this link: …
Chris Phillips
  • 1,997
  • 2
  • 19
  • 34
1
vote
1 answer

Comments & Nested Code Folding in PyCharm

Why does PyCharm fold newline comments at the end of a nested code block into the previous block? Example (try folding the first "if" block): def print_me(a): # newline comment if a == 'me': dummy_padding = '' if not…
R J
  • 4,473
  • 2
  • 22
  • 29
1
vote
0 answers

Manual vim code folds keep moving

I prefer to make my code folds manually. However, I've noticed that the folds move after I Make the fold using zf Make some deletes/inserts after/below the code fold The folds "move" in the sense that if 51 lines were folded, after movement only…
J-Win
  • 1,322
  • 16
  • 35
1
vote
0 answers

how to add code folding to output in visual studio output window

It is possible to use code folding inside the source in visual studio, however it would also be very useful if folding could be added to output made to the visual studio output window If you want to write to output window from within a unittest case…
serup
  • 3,676
  • 2
  • 30
  • 34
1
vote
2 answers

Visual Studio 2015 collapse/toggle XML comments only

I want to know if there is a way to collapse/toggle only XML function comments. If I choose Collapse to Definitions in Visual Studio 2015, that collapses all of my functions as well as the accompanying XML comments, I want a way to collapse/toggle…
D. Foley
  • 1,034
  • 1
  • 9
  • 23
1
vote
0 answers

Eclipse how to fold a block of code that is neither function nor structure?

Is it possible to fold blocks of C++ code in Eclpise (neon). With the default folding options functions, structures, etc are nicely folded, but blocks of code cannot be folded, eg. void foo(){ // <- can be folded ... } void…
463035818_is_not_an_ai
  • 109,796
  • 11
  • 89
  • 185
1
vote
0 answers

Why does code folding HTML in Sublime break with my