function(text, from) {
			var len = text.length,
				start = 0,
				end = len - 1;
			
			// search left
			for (var i = from - 1; i > 0; i--) {
				var ch = text.charAt(i);
				if (ch == '\n' || ch == '\r') {
					start = i + 1;
					break;
				}
			}
			// search right
			for (var j = from; j < len; j++) {
				var ch = text.charAt(j);
				if (ch == '\n' || ch == '\r') {
					end = j;
					break;
				}
			}
			
			return require('range').create(start, end - start);
		}
function(text, from) {
			var len = text.length,
				start = 0,
				end = len - 1;
			
			
			for (var i = from - 1; i > 0; i--) {
				var ch = text.charAt(i);
				if (ch == '\n' || ch == '\r') {
					start = i + 1;
					break;
				}
			}
			
			for (var j = from; j < len; j++) {
				var ch = text.charAt(j);
				if (ch == '\n' || ch == '\r') {
					end = j;
					break;
				}
			}
			
			return require('range').create(start, end - start);
		}
function ( text , from ) { var len = text . length , start = 0 , end = len - 1 ; // search left for ( var i = from - 1 ; i > 0 ; i -- ) { var ch = text . charAt ( i ) ; if ( ch == '\n' || ch == '\r' ) { start = i + 1 ; break ; } } // search right for ( var j = from ; j < len ; j ++ ) { var ch = text . charAt ( j ) ; if ( ch == '\n' || ch == '\r' ) { end = j ; break ; } } return require ( 'range' ) . create ( start , end - start ) ; }
Find start and end index of text line for <code>from</code> index
@param {String} text
@param {Number} from
Find start and end index of text line for <code > from< / code > index