TextSelection Plugin for the CKEditor

Demos

Source Area with CodeMirror Plugin

The plugin that makes the editor keep it's text-selection when switching between WYSIWYG and Source mode (with CodeMirror), and scrolls the selection into the viewport.

To enable this plugin, basically add extraPlugins: 'codemirror,textselection' to editor's config:

// Framed editor.
CKEDITOR.replace( 'textarea_id', {
                extraPlugins: 'codemirror,textselection'
});

How to use the plugin

Simply set the cursor to any text position or select some text. Then Switch to Source Mode, the cursor or selection will keep the position. This works also when you switch from Source to WYSIWYG.