code: function getLengthOfPrecedingTextNodes( node ) {
  				var sum = 0;
  
  				while ( ( node = node.getPrevious() ) && node.type == CKEDITOR.NODE_TEXT )
  					sum += node.getLength();
  
  				return sum;
  			}
docs: Sums lengths of all preceding text nodes.