Question

I would like to know if using ace editor is possible to hide some lines of the content of the editor.

In particular I am interested in hiding some lines like:

%Some Tag useful to find particular chunk of code in the editor

Example:

BEGIN My theory


%Block:Function id:tick
Myfunction() {}

END

I have been using The tag ( %...) to help myself to find Myfunction() {} , because I need to modify that particular part of code. So, I wouldn't show that line to the user, but I would use it as tag so keeping it in the content of the editor. I cannot use reference like the number of row because it may change.

Thank you

Was it helpful?

Solution

you can use addFold

var Range=require("ace/range").Range;
editor.session.addFold("", new Range(1,0,2,0))

first argument to addFold is the placeholder text and the second one is the range which you want to hide

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top