Hello,
I would like to know if there is any possibility to mode cursor to some specific node.
For example: Let say cursor is at the end of some line and you press enter and you would like to jump to previous position (end of line).
I tried:
var selection = getEditorInstance().window.$.getSelection(); var newRange = getEditorInstance().document.$.createRange(); var e=getEditorInstance().getSelection().getRanges(), f=e[0]; var oldNode = f.getPreviousNode(); if (oldNode != null) { newRange.setStart(oldNode, 0); selection.removeAllRanges(); selection.addRange(newRange); }
But it doesn't work. So I'm asking, if this is even possible and if yes - how?