function _positionForIndex(index) {
    var textTillIndex = el.value.substring(0,index);
    var row = (textTillIndex.match(/\n/g) || []).length + 1;
    var col = textTillIndex.length - textTillIndex.lastIndexOf("\n");

    return {
      row: row,
      column: col
    }
  }
function _positionForIndex(index) {
    var textTillIndex = el.value.substring(0,index);
    var row = (textTillIndex.match(/\n/g) || []).length + 1;
    var col = textTillIndex.length - textTillIndex.lastIndexOf("\n");

    return {
      row: row,
      column: col
    }
  }
function _positionForIndex ( index ) { var textTillIndex = el . value . substring ( 0 , index ) ; var row = ( textTillIndex . match ( / \n / g ) || [ ] ) . length + 1 ; var col = textTillIndex . length - textTillIndex . lastIndexOf ( "\n" ) ; return { row : row , column : col } }
Returns textarea row and column position for certain index
@param {Number} index text index
@returns {{row: Number, col: Number}}
Returns textarea row and column position for certain index