zbug
zbug

Reputation: 1043

Using multiple ace editor instances with different completers

how could I set up individual completers per ace editor instance?

I am using multiple editors in my application. - setting completers on the languageTools object seems to just add duplicates for all editor instances at once

     langTools.addCompleter(myCompleter);

(All editors should keep their default completers)

Upvotes: 3

Views: 740

Answers (1)

zbug
zbug

Reputation: 1043

In my second example, the completers were handed by reference, so I was always adding completers to the central list of completers, which ended up in duplicates.

This works:

editor.completers = editor.completers.slice();
editor.completers.push(myCompleter);

Upvotes: 7

Related Questions