setSession trashes wrap option

12 views
Skip to first unread message

Brad Moran

unread,
Jun 2, 2021, 2:45:37 PMJun 2
to Ajax.org Cloud9 Editor (Ace)
After much hair-pulling, i figured out that editor.setSession() was turning off the wrap option, which was unexpected. Is this intended? Which other options are affected?

Do you need to re-apply settings after changing the session? I would expect that editor options are editor specific and not session specific. 

Harutyun Amirjanyan

unread,
Jun 2, 2021, 2:53:25 PMJun 2
to ace-d...@googlegroups.com
EditSessionOptions https://github.com/ajaxorg/ace/blob/master/ace.d.ts#L156-L169 are session specific, editor only gives an easier shortcut to modify them on the current session. (this includes options like mode folding, wrapping etc.)

The intention behind this design is to allow using setSession for editor tabs, user can have different wrap configurations for different tabs and it would be undesirable to change this when a tabs is dragged from one column to the other.

Brad Moran

unread,
Jun 2, 2021, 3:05:44 PMJun 2
to Ajax.org Cloud9 Editor (Ace)
Ok, thanks. This is the info I needed

Brad Moran

unread,
Jun 2, 2021, 4:49:38 PMJun 2
to Ajax.org Cloud9 Editor (Ace)
Note, however, that it's also undesirable to have to restore these settings when using a 1 editor per instance model and loading content and file info from soft tabs.
Reply all
Reply to author
Forward
0 new messages