PreviousNextTracker indexSee it online !

(142/212) 374 - Hide text regions in the buffer from the text area

Allow a configurable engine for hiding selected regions of text from the text area.
For example: In C/C++, hide parts of the buffer that are excluded from the current build configuration (e.g. using #ifdef ...).

This can be extended to different syntax highlight styles for different regions of text. For example, MS Developer Studio shows the text in the above example in gray, while the rest of the text is syntax highlighted. Another example: Mylyn (an eclipse plugin) colors text according to the frequency of visiting it. A function that was never visited (by browsing through the source code) is hidden; frequently visited text is colored "darker" than rarely visited text.

Submitted nobody - 2010-09-24 03:29:42 Assigned
Priority 5 Labels ConfigurableFoldHandler
Status pending Group v5.2
Resolution None

Comments

2010-09-24 03:31:40
*anonymous

In addition, when some buffer text is hidden from the text area, the folding should apply only to the visible lines - as if the hidden text is not part of the buffer. That is, the folding should be applied on the result of the filtering.

2010-09-25 12:29:37
rschwenn

Sounds like an ambitious plan. Two notes:

1. One way to filter lines could be "simply" to use a hyper search result.
2. It would be perfect if operations like search&replace or column cursor editing could ignore the hidden lines.

2010-09-26 07:18:02
*anonymous

An ambitious plan, yes. But I think it's a very useful feature.
1. How would you use hypersearch results for filtering? The filtering may, for example, include all the text between a "#if" and its "#end".
2. I don't think so, but I think that the filtering should be easily turned off (or modified to select another criteria for filtering) using the UI.

One thing missing here is how to apply the filter during editing. It seems like me like this should use a mechanism similar to the syntax highlighting.

2010-09-26 11:43:54
rschwenn

Some time ago a user asked for a feature which is found in "The Hessling Editor" ( http://hessling-editor.sourceforge.net/ ). It lets You hide all lines that don't match a criteria (i.e. a search text) and then lets You edit only the displayed lines.

So I thought, that using the line numbers of hyper search results could be one way of filtering for Your "configurable engine". But if this hasn't been Your intent, I won't ask for this feature.

2013-12-09 19:24:18.677000
ezust

- **labels**: core --> ConfigurableFoldHandler
- **status**: open --> pending
- **Group**: --> v5.2

2013-12-09 19:24:23.783000
ezust

Can you get something like this from ConfigurableFoldHandler?
Define the start/end of the folds as regexes, and then you can expand/collapse the folds to show/hide those regions.

If not, this sounds like a feature request for ConfigurableFoldHandler.

2013-12-10 12:06:40.011000
*anonymous

Well, yes and no. Possibly you can define the regions in ConfigurableFoldHandler, but the feature request is deeper. I would like to have the option to either hide the regions completely (not fold them, hide them - it's not the same as considering the preceding line to be the start of a fold containing the region, as I want the folding to be used only on the visible lines and not on those hidden - and don't want to see dummy folds).
ConfigurableFoldHandler is for folding only. The core needs to change in order to support hidden (not folded!) regions.