src/vs/editor/browser/controller/textAreaHandler.ts/TextAreaHandler/_newlinecount
class TextAreaHandler:	private _newlinecount(text: string): number {
		let result = 0;
		let startIndex = -1;
		do {
			startIndex = text.indexOf('\n', startIndex + 1);
			if (startIndex === -1) {
				break;
			}
			result++;
		} while (true);
		return result;
	}