|
@@ -117,10 +117,15 @@ App.directive('aceEditor', function(
|
|
|
const editor = ace.edit(element.find('.ace-editor-body')[0])
|
|
const editor = ace.edit(element.find('.ace-editor-body')[0])
|
|
|
editor.$blockScrolling = Infinity
|
|
editor.$blockScrolling = Infinity
|
|
|
|
|
|
|
|
- // end-to-end check for edits -> acks, globally on any doc
|
|
|
|
|
- // This may catch a missing attached ShareJsDoc that in turn bails out
|
|
|
|
|
- // on missing acks.
|
|
|
|
|
- ide.globalEditorWatchdogManager.attachToEditor('Ace', editor)
|
|
|
|
|
|
|
+ // Besides the main editor, other elements will re-use this directive
|
|
|
|
|
+ // for displaying read-only content -- e.g. the history panes.
|
|
|
|
|
+ const editorAcceptsChanges = attrs.aceEditor === 'editor'
|
|
|
|
|
+ if (editorAcceptsChanges) {
|
|
|
|
|
+ // end-to-end check for edits -> acks, globally on any doc
|
|
|
|
|
+ // This may catch a missing attached ShareJsDoc that in turn bails out
|
|
|
|
|
+ // on missing acks.
|
|
|
|
|
+ ide.globalEditorWatchdogManager.attachToEditor('Ace', editor)
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// auto-insertion of braces, brackets, dollars
|
|
// auto-insertion of braces, brackets, dollars
|
|
|
editor.setOption('behavioursEnabled', scope.autoPairDelimiters || false)
|
|
editor.setOption('behavioursEnabled', scope.autoPairDelimiters || false)
|