From: Aleksander Ɓukasz Date: Mon, 19 Aug 2013 13:15:56 +0000 (+0200) Subject: Wrap text in source editor X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/a7ecaf4f3e67d670f3009e35e3c78baa8952890a Wrap text in source editor --- diff --git a/modules/sourceEditor/sourceEditor.js b/modules/sourceEditor/sourceEditor.js index 2fca370..e88e5e1 100644 --- a/modules/sourceEditor/sourceEditor.js +++ b/modules/sourceEditor/sourceEditor.js @@ -6,9 +6,12 @@ return function(sandbox) { var view = $(sandbox.getTemplate('main')()); - var editor = ace.edit(view.find('#rng-sourceEditor-editor')[0]); + var editor = ace.edit(view.find('#rng-sourceEditor-editor')[0]), + session = editor.getSession(); editor.setTheme("ace/theme/chrome"); - editor.getSession().setMode("ace/mode/xml"); + session.setMode("ace/mode/xml") + session.setUseWrapMode(true); + $('textarea', view).on('keyup', function() { sandbox.publish('xmlChanged'); });