calccaretpos

Calculates the position of the caret with x and y position in the text. Y=line number and X=position in the line. You can re the values from dec.xpos and dec.ypos. The values are set to elements with id="xpos" and id="ypos"

$('div[contenteditable]').on('keyup',function(e){dec.editorkeyuphandler(e)});
$('div[contenteditable]').on('focus',function(){dec.calccaretpos()});
$('div[contenteditable]').on('click',function(){dec.calccaretpos()});<br>

How this is initiated. It is also called form the editorkeyuphandler handler when you move around in the editor