CppLearner
CppLearner

Reputation: 17040

Ace editor's setAnnotations won't stay permanent

I have trouble getting my annotation to stay. See this jsfiddle: http://jsfiddle.net/c8k45yw1/5/

What you will see is line 2, which I set manually, will have "X" mark appear for half a second before it disappear. Thoughts?

var editor = ace.edit("editor");
editor.setTheme("ace/theme/chrome");
editor.getSession().setMode("ace/mode/javascript");
//editor.session.setBreakpoint(2);
editor.getSession().setAnnotations([{
  row: 1,
  column: 0,
  text: "Strange error",
  type: "error" // also warning and information
}]);

Upvotes: 2

Views: 6856

Answers (1)

a user
a user

Reputation: 24104

Syntax checker in ace uses same setAnnotations api, and clears old anotations. You can disable it with editor.session.setOption("useWorker", false)

Upvotes: 13

Related Questions