2

I've tried, editor.session.setOption("useWorker", false);

but this seems to also turn off syntax highlighting - how should I get around this?

2 Answers 2

2

you probably have a typo somewhere else, it works in the attached example

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <script src="http://ajaxorg.github.io/ace-builds/src/ace.js"></script> 
  <style>
    #editor1, #editor2 { position: absolute; top: 0; left: 0; right: 0; bottom: 0;}
    #editor1 {bottom: 50%}
    #editor2 {top: 50%}
  </style>
</head>
<body>
 <div id="editor1">var + jshint</div>
 <div id="editor2">var + no jshint</div>
 <script>
   var editor1 = ace.edit("editor1")
   editor1.session.setMode("ace/mode/javascript");
   var editor2 = ace.edit("editor2")
   editor2.session.setMode("ace/mode/javascript")
   editor2.session.setOption("useWorker", false);
 </script>  
</body>
</html>

Sign up to request clarification or add additional context in comments.

Comments

1

in angular, if we use options like below we can prevent highlight syntax errors. I have tried, options: any = { maxLines: 1000, printMargin: false,useWorker:false };

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.