id summary reporter owner description type status priority milestone component version resolution keywords cc 12753 CodeSnippet's setHighlighter() can be only executed while initialising plugins Piotrek Koszuliński "TC: 1. Add `console.log( editor.name );` at the beginning of `setHighlighter()` in the `codesnippet/plugin.js` file. 2. Load the code snippet sample. 3. See that 'editor1' and 'editable' were logged correctly. 4. Execute: `CKEDITOR.instances.editor1.plugins.codesnippet.setHighlighter( 1 );` 5. Result: * Expected: `editor1` should be logged. * Actual: `editable` is logged. **Note**: If in step 3 the order for you was different, then in next steps switch the names (editor1 and editable). The reason why `setHighlighter()` will always set it for the last editor is that it's bound to the plugin instance and unfortunately plugins instances are shared between editors. This sounds terribly, but it's not that bad, since all plugins for one editor are always initialised synchronously, so the `setHighlighter()` method will always work correctly in the init callbacks of a plugin. Therefore, the easiest solution is adding this information to the documentation. A real solution, unfortunately, will be to move `setHighlighter()` to `CKEDITOR.plugins.codeSnippet` and pass editor instance to it. This is of course not backwards compatible change, but we could keep the `editor.plugins.codesnippet.setHighlighter()` method and mark it as deprecated." Bug closed Normal CKEditor 4.4.7 General fixed