Merge pull request #965 from simonzack/ace_hook

added an initAce hook to allow configuration of the live editor
This commit is contained in:
Sunny Ripert
2015-01-28 17:00:43 +01:00
@@ -36,7 +36,6 @@ var MarkdownMode = require( 'ace/mode/markdown' ).Mode;
function initAce( editor, editorSession ) {
editorSession.setUndoManager(new UndoManager());
editor.setTheme( 'ace/theme/twilight' );
editorSession.setMode( new MarkdownMode() );
// Gutter shows line numbers
editor.renderer.setShowGutter( true );
@@ -46,6 +45,11 @@ function initAce( editor, editorSession ) {
editorSession.setUseWrapMode( true );
editor.setShowPrintMargin( false );
editor.setBehavioursEnabled( true );
if ( win.initAce ) {
win.initAce(editor, editorSession);
} else {
editor.setTheme( 'ace/theme/twilight' );
}
}
initAce( editor, editorSession );