src/vs/editor/common/cursor/cursor.ts/CompositionState/_deduceOutcome
class CompositionState:	private static _deduceOutcome(original: CompositionLineState, current: CompositionLineState): CompositionOutcome {
		const commonPrefix = Math.min(
			original.startSelection,
			current.startSelection,
			strings.commonPrefixLength(original.text, current.text)
		);
		const commonSuffix = Math.min(
			original.text.length - original.endSelection,
			current.text.length - current.endSelection,
			strings.commonSuffixLength(original.text, current.text)
		);
		const deletedText = original.text.substring(commonPrefix, original.text.length - commonSuffix);
		const insertedText = current.text.substring(commonPrefix, current.text.length - commonSuffix);
		return new CompositionOutcome(
			deletedText,
			original.startSelection - commonPrefix,
			original.endSelection - commonPrefix,
			insertedText,
			current.startSelection - commonPrefix,
			current.endSelection - commonPrefix
		);
	}