{
const editable = CKEDITOR.instances[Object.keys(CKEDITOR.instances)[0]].editable().$;
const doc = editable.ownerDocument;
let i = 0;
globalThis.caretWalk = setInterval(() => {
const blocks = editable.querySelectorAll('p, h1, h2, h3, li');
if (blocks.length < 2) {
return console.warn('Need at least two blocks in the content.');
}
const range = doc.createRange();
range.selectNodeContents(blocks[i++ % blocks.length]);
range.collapse(true);
const selection = doc.defaultView.getSelection();
selection.removeAllRanges();
selection.addRange(range);
}, 1000);
}