added an initAce hook to allow configuration of the live editor
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user