Why does ace editor load with all text highlighted and how to remove it?
ace-editor, angular-ui, angularjs
Solution
Use `_editor.session.setValue($scope.aceIDEs);` which also resets undomanager. Alternatively you can use `_editor.setValue($scope.aceIDEs, cursorPos);`. where `cursorPos=-1` puts cursor at start and `cursorPos=1` at the end. Or call `_editor.clearSelection()` after setting value.
Problem
My code looks like : ``` $scope.aceIDEs='var hw = new function() {\n console.log("Hello world!");\n}' $scope.loadAceJSExample = function (_editor) { _editor.setValue($scope.aceIDEs); _editor.getSession().setUseWorker(false); _editor.setHighlightActiveLine(true); }; ``` And: ``` <div class="container fade-in" style='padding: 4em;'> <div> ui-ace="{onLoad : loadAceJSExample, onChange : aceJSExampleChanged, useWrapMode : true, theme : 'github', showGutter: true, mode: 'javascript' }" /> ``` I tried calling _editor.getSession().removeMarker(); but did not help Every time i refresh it looks like this,once i click in it returns to normal: