UNPKG

monaco-editor

Version:
23 lines (22 loc) 1.28 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { Disposable } from '../../../../base/common/lifecycle.js'; import { registerEditorContribution } from '../../../browser/editorExtensions.js'; class LongLinesHelper extends Disposable { constructor(_editor) { super(); this._editor = _editor; this._register(this._editor.onMouseDown((e) => { const stopRenderingLineAfter = this._editor.getOption(116 /* EditorOption.stopRenderingLineAfter */); if (stopRenderingLineAfter >= 0 && e.target.type === 6 /* MouseTargetType.CONTENT_TEXT */ && e.target.position.column >= stopRenderingLineAfter) { this._editor.updateOptions({ stopRenderingLineAfter: -1 }); } })); } } LongLinesHelper.ID = 'editor.contrib.longLinesHelper'; registerEditorContribution(LongLinesHelper.ID, LongLinesHelper, 2 /* EditorContributionInstantiation.BeforeFirstInteraction */);