/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import './textAreaHandler.css'; import * as nls from '../../../nls.js'; import * as browser from '../../../base/browser/browser.js'; import { createFastDomNode } from '../../../base/browser/fastDomNode.js'; import * as platform from '../../../base/common/platform.js'; import * as strings from '../../../base/common/strings.js'; import { applyFontInfo } from '../config/domFontInfo.js'; import { CopyOptions, TextAreaInput, TextAreaWrapper } from './textAreaInput.js'; import { PagedScreenReaderStrategy, TextAreaState, _debugComposition } from './textAreaState.js'; import { PartFingerprints, ViewPart } from '../view/viewPart.js'; import { LineNumbersOverlay } from '../viewParts/lineNumbers/lineNumbers.js'; import { Margin } from '../viewParts/margin/margin.js'; import { EditorOptions } from '../../common/config/editorOptions.js'; import { getMapForWordSeparators } from '../../common/core/wordCharacterClassifier.js'; import { Position } from '../../common/core/position.js'; import { Range } from '../../common/core/range.js'; import { Selection } from '../../common/core/selection.js'; import { MOUSE_CURSOR_TEXT_CSS_CLASS_NAME } from '../../../base/browser/ui/mouseCursor/mouseCursor.js'; import { TokenizationRegistry } from '../../common/languages.js'; import { Color } from '../../../base/common/color.js'; class VisibleTextAreaData { constructor(_context, modelLineNumber, distanceToModelLineStart, widthOfHiddenLineTextBefore, distanceToModelLineEnd) { this._context = _context; this.modelLineNumber = modelLineNumber; this.distanceToModelLineStart = distanceToModelLineStart; this.widthOfHiddenLineTextBefore = widthOfHiddenLineTextBefore; this.distanceToModelLineEnd = distanceToModelLineEnd; this._visibleTextAreaBrand = undefined; this.startPosition = null; this.endPosition = null; this.visibleTextareaStart = null; this.visibleTextareaEnd = null; /** * When doing composition, the currently composed text might be split up into * multiple tokens, then merged again into a single token, etc. Here we attempt * to keep the presentation of the