mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
Add color decorator limit to 500 (#11862)
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
|
||||
import {window, workspace, DecorationOptions, DecorationRenderOptions, Disposable, Range, TextDocument, TextEditor} from 'vscode';
|
||||
|
||||
const MAX_DECORATORS = 500;
|
||||
|
||||
let decorationType: DecorationRenderOptions = {
|
||||
before: {
|
||||
contentText: ' ',
|
||||
@@ -76,7 +78,7 @@ export function activateColorDecorations(decoratorProvider: (uri: string) => The
|
||||
let document = editor.document;
|
||||
if (supportedLanguages[document.languageId]) {
|
||||
decoratorProvider(document.uri.toString()).then(ranges => {
|
||||
let decorations = ranges.map(range => {
|
||||
let decorations = ranges.slice(0, MAX_DECORATORS).map(range => {
|
||||
let color = document.getText(range);
|
||||
return <DecorationOptions>{
|
||||
range: range,
|
||||
|
||||
Reference in New Issue
Block a user