added an initAce hook to allow configuration of the live editor

This commit is contained in:
simonzack
2015-01-27 19:46:39 +11:00
parent e183260d0a
commit 33e8d4f328
@@ -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 );