How to force a soft line wrap?

51 views
Skip to first unread message

Alexander Gladysh

unread,
Apr 21, 2016, 10:35:05 AM4/21/16
to Ajax.org Cloud9 Editor (Ace)
Hi, all!

I'm writing a mode for my toy template language.

In the language there is a construct to embed a newline:

foo{\n}bar

When a template is rendered, it will be replaced with a newline, as follows:

foo
bar

I would like to imitate this in the editor and force a soft wrap after {\n}:

1 | foo{\n} 
  | bar

Is there a way to do this without hacking too deep in the ACE source code?

Best,
Alexander.

Harutyun Amirjanyan

unread,
Apr 29, 2016, 3:00:41 PM4/29/16
to ace-d...@googlegroups.com
Hi
Unfortunately there is no easy way to do this. 
It may be possible to achieve the effect by modifying https://github.com/ajaxorg/ace/blob/edd676ba791885436bcad66fa739faa32bf7b3d9/lib/ace/edit_session.js#L1804, but it is likely to require non-trivial amount of work

Best,
Harutyun
Reply all
Reply to author
Forward
0 new messages