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
0
votes
0 answers

PHP Break Line Character For Function Arguments

I have this code : public function registerNew ($first_name, $last_name, $email, $phone, $password, $bank_name, $bank_account_number, $bank_account_name, $gender, $birthday, $address, $area, $signup_date, $activated, $first_login, $token,…
Saint Robson
  • 5,475
  • 18
  • 71
  • 118
0
votes
1 answer

Visual Studio Setup when first viewing a page

Is there a way to setup visual studio 2008 to automatically collapse regions/functions/methods when the code behind is first opened?
Yogurt The Wise
  • 4,379
  • 4
  • 34
  • 42
0
votes
1 answer

how to enable code folding in android studio?

in android studio right click on my code and folding->collapse or expand all does not work. also Ctrl + or Ctrl - does not work. how to enable code folding in android studio?
ali
  • 411
  • 5
  • 15
0
votes
1 answer

Fold and unfold code in Visual Studio CODE

I can't find out how to fold and unfold code (like javascript functions) in Visual Studio Code. In Visual Studio the shortcut is "Ctrl + L", but it doesn't work in Visual Studio Code (not the full Visual Studio but the lightweight Code…
0
votes
1 answer

How to fold for, while and if blocks in Java Eclipse

I'm using Eclipse Luna for Java. By default, Eclipse only lets me fold Comments, Header Comments, Inner Types, Members and Imports. Is there a plugin that allows me to fold for, while and if blocks? I searched the marketplace and various sources and…
user1766833
  • 45
  • 1
  • 7
0
votes
0 answers

Syntax Folding: Commenting start and end of block results code inside highlighted as comment

I am just starting with VIM and trying to use syntax highlighting. When start and end of fold is commented, whole block inside is highlighted as comment. Is it possible to highlight it normally? I included following in my snytax file: …
smhrjn
  • 506
  • 3
  • 9
0
votes
1 answer

How to preserve code folding when formatting source

See also this question: How do I avoid expanding folded regions when I invoke the code formatter? This is not a dupe, because I'm interested in solving the problem using the ToolsApi. When I press CTRL + D the code formats nicely (mostly). But…
Johan
  • 74,508
  • 24
  • 191
  • 319
0
votes
0 answers

cold folding is not working in netbean for javascript

I recently shifted to Ubuntu and downloaded Netbean IDE 8.0. I have a large html file that contains javascript, CSS and HTML. I go to tool->options->editor->folding and enable code folding for all languages. I restarted netbean even my system but…
Sarfraz Ahmed
  • 1,349
  • 6
  • 23
  • 43
0
votes
2 answers

Eclipse Juno colored code folding areas

Recently I have started to experience issues with colored code folding in Eclipse. I would like to eliminate the colored regions in eclipse and just stick with a white background. If anyone could help me get rid of the boxes and the green…
Chris.Stover
  • 516
  • 6
  • 14
0
votes
1 answer

How to 'expand all' in Aptana Studio 3's code folding feature

In Aptana Studio 3, I have noticed that you can perform the following operation. Right click on some code in a document > Commands > Source > Folding > Toggle Foldings at Level > All Levels However, instead of toggling the folding I wish to…
JW.
  • 4,821
  • 5
  • 43
  • 60
0
votes
1 answer

How to get all folded lines from StyledText

In my eclipse plugin, I have a StyledText object and IEditorReference object. I also have a yCoordinate that I want to use to check which line number is below this coordinate: int lineIndex = styledText.getLineIndex(yCoordinate); This works…
user6189
  • 653
  • 1
  • 7
  • 15
0
votes
1 answer

Notepad++ Codefolding - Everything but the header is under body tag?

basically, under the tag i have , , and
. under those i have the divs and whatever. using the codefolding, i can have just , and everything else hide. if i expand that, i get the ability to expand , and…
0
votes
1 answer

How to fix incorrect folding of Ruby for Geany

Some Ruby code won't fold correctly in Geany. For example, if I have def validate(arr) if arr.any?(&:empty?) fail end end validate(["a", "b", "c"]) validate([""]) then folding the if folds too much: Whereas if I use quotation marks…
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
0
votes
1 answer

Configure code folding in LightTable

LightTable has code folding since v0.6.1, it's key binding is C-= by default. It works for Python files out of the box, but it does nothing with Clojure files. The Codemirror code sets fold to "indent" at…
Adam Schmideg
  • 10,590
  • 10
  • 53
  • 83
0
votes
0 answers

Is there any way to auto fold PHP docblocs in sublime

Is there an easy way that will automatically fold all docblocs for PHP/JS/HTML/CSS ? The docblocs in my code can be quite long, it makes navigating the code quite difficult. Is there anyway to do this simply with a preference setting or a simple…
Manquer
  • 7,390
  • 8
  • 42
  • 69
1 2 3
13
14