Pregunta

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

¿Fue útil?

Solución

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top