File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- var buildDom = require ( "ace/lib/dom" ) . buildDom ;
1+ var buildDom = ace . require ( "ace/lib/dom" ) . buildDom ;
2+ var snippetManager = ace . require ( "ace/snippets" ) . snippetManager ;
23var editor = ace . edit ( ) ;
34editor . setOptions ( {
45 theme : "ace/theme/tomorrow_night_eighties" ,
@@ -57,20 +58,18 @@ buildDom([
5758 "button" , {
5859 style : "font-weight: bold" ,
5960 onclick : function ( ) {
60- editor . insertSnippet ( "**${1:$SELECTION}**" ) ;
61+ snippetManager . insertSnippet ( editor , "**${1:$SELECTION}**" ) ;
6162 editor . renderer . scrollCursorIntoView ( ) ;
6263 }
6364 } , "bold"
6465 ] , [
6566 "button" , {
6667 style : "font-style: italic" ,
6768 onclick : function ( ) {
68- editor . insertSnippet ( "*${1:$SELECTION}*" ) ;
69+ snippetManager . insertSnippet ( editor , "*${1:$SELECTION}*" ) ;
6970 editor . renderer . scrollCursorIntoView ( ) ;
7071 }
7172 } , "Italic"
7273 ]
7374] , document . body , refs ) ;
7475document . body . appendChild ( editor . container ) ;
75-
76- window . editor = editor ;
You can’t perform that action at this time.
0 commit comments