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 ) {
|
function initAce( editor, editorSession ) {
|
||||||
editorSession.setUndoManager(new UndoManager());
|
editorSession.setUndoManager(new UndoManager());
|
||||||
editor.setTheme( 'ace/theme/twilight' );
|
|
||||||
editorSession.setMode( new MarkdownMode() );
|
editorSession.setMode( new MarkdownMode() );
|
||||||
// Gutter shows line numbers
|
// Gutter shows line numbers
|
||||||
editor.renderer.setShowGutter( true );
|
editor.renderer.setShowGutter( true );
|
||||||
@@ -46,6 +45,11 @@ function initAce( editor, editorSession ) {
|
|||||||
editorSession.setUseWrapMode( true );
|
editorSession.setUseWrapMode( true );
|
||||||
editor.setShowPrintMargin( false );
|
editor.setShowPrintMargin( false );
|
||||||
editor.setBehavioursEnabled( true );
|
editor.setBehavioursEnabled( true );
|
||||||
|
if ( win.initAce ) {
|
||||||
|
win.initAce(editor, editorSession);
|
||||||
|
} else {
|
||||||
|
editor.setTheme( 'ace/theme/twilight' );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initAce( editor, editorSession );
|
initAce( editor, editorSession );
|
||||||
|
|||||||
Reference in New Issue
Block a user