src/vs/base/common/strings.ts/GraphemeIterator/prevGraphemeLength
class GraphemeIterator:	public prevGraphemeLength(): number {
		const graphemeBreakTree = GraphemeBreakTree.getInstance();
		const iterator = this._iterator;
		const initialOffset = iterator.offset;

		let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.prevCodePoint());
		while (iterator.offset > 0) {
			const offset = iterator.offset;
			const prevGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.prevCodePoint());
			if (breakBetweenGraphemeBreakType(prevGraphemeBreakType, graphemeBreakType)) {
				// move iterator back
				iterator.setOffset(offset);
				break;
			}
			graphemeBreakType = prevGraphemeBreakType;
		}
		return (initialOffset - iterator.offset);
	}