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
3
votes
1 answer

Matlab Run Section not working

I encountered an annoying problem with Matlab 2016b: I cannot run folded code sections separately. More specifically, in Matlab editor buttons "Run and Advance" ans "Run Section" appear grey (unclickable) and Ctrl+Enter to run a code section does…
vvv
  • 145
  • 3
  • 9
3
votes
1 answer

Notepad++ Code Folding Opens and Closes are mispositioned by several lines

So I've made a user defined language in Notepad++ to organize a writing project. I know how to do code-folding, and for the past several months it has worked well. The problem is that recently, the code-folding function is several lines off from the…
3
votes
2 answers

Xcode expand/collapse braces/brackets {} side bar missing

The side bar, next to the code line numbers, that allows expansion/collapsing of brace/brackets {} is no longer showing in Xcode. I am trying to figure out how to get it back.
SAHM
  • 4,078
  • 7
  • 41
  • 77
3
votes
1 answer

Netbeans 8.0 - Preferences for code folding

I have recently switched to using Netbeans IDE 8.0 for a PHP project and would like to know if it's possible to either:- Configure NetBeans to remember my code fold status (open/ closed) when I save the file Automatically fold only functions upon…
Phill
  • 213
  • 1
  • 2
  • 9
3
votes
1 answer

Is there a way to make the "Code Folding" Stay Folded In Delphi 2010

I absolutely love the Code Folding feature inside Delphi 2010. However, each time start Delphi 2010 and reopen my project the code I had peviously folded down is no longer folded. Is there a way to keep the folded code, folded when you close down…
3
votes
1 answer

Code folding in RichTextBox

I am working on a Code Editor derived from Winforms RichTextBox using C#. I have already implemented autocompletion and syntax hilighting, but code folding is somewhat a different approach. What I want to achieve is: The code below: public static…
devavx
  • 1,035
  • 9
  • 22
3
votes
1 answer

Code folding in external files with knitr and RStudio

I can find no way to insert syntactically acceptable RStudio style folds into an external R code file that is set up for use from a knitr document. Or am I missing something. There are several ways this might be done: 1) Allow a code header such…
2
votes
3 answers

Xcode : shortcut for highlight feature

I recently started using Xcode for developing. It's pretty neat. By accident I happened to see one of its features. The feature only highlights the block of code I am currently working on. Other codes are covered with light grey. I do not know how…
sammiwei
  • 3,140
  • 9
  • 41
  • 53
2
votes
0 answers

How to Write a Visual Studio Macro to "Collapse to Definition" without Collapsing Comments?

One of the thing that I would love in Visual Studio is when I collapse to definitions (or use other code-folding options in VS). I personally/humbly disagree with using the region directive, so I'm looking for an alternative to that. There isn't…
undeniablyrob
  • 1,339
  • 2
  • 16
  • 16
2
votes
2 answers

Collapse / Fold methods in Aptana?

I'm not sure if I'm missing something as I'm new to Aptana but. I'm having trouble collapsing my class methods. I like to collapse everything except the function I'm currently working in within my class but everytime collapse and then go to edit,…
Giuseppe
  • 288
  • 2
  • 12
2
votes
1 answer

What is the key or command to fold siblings' code in GoLand?

In unit tests, we specify large, deeply-nested structures as data and as expected values. I have learned about folding the current block with C-minus and C-period (one is named Collapse and one is named Fold, which seems like a distinction without…
2
votes
1 answer

How to fold the code in Xcode Swift iOS by default

I know that we can fold the code by using Option+Command+Shift+LeftKey. But what I want to know that, can we do something to fold the code by default in every View Controller's class that means whenever we search for or open any class it's code is…
Ali Abid
  • 39
  • 6
2
votes
1 answer

Support folding Pug blocks in Vue in VS Code

Is there a way to get VS Code to support folding blocks within Pug when used in Vue single-file components? That is: