11'use strict' ;
22import { Functions } from '../system' ;
3- import { DecorationOptions , Disposable , TextDocument , TextEditor , TextEditorDecorationType , TextEditorSelectionChangeEvent , Uri , window } from 'vscode' ;
3+ import { DecorationOptions , Disposable , Range , TextDocument , TextEditor , TextEditorDecorationType , TextEditorSelectionChangeEvent , Uri , window } from 'vscode' ;
44import { FileAnnotationType } from '../configuration' ;
55import { TextDocumentComparer } from '../comparers' ;
66import { GitDocumentState , TrackedDocument } from '../trackers/documentTracker' ;
@@ -58,10 +58,10 @@ export abstract class AnnotationProviderBase extends Disposable {
5858 return this . editor . document . uri ;
5959 }
6060
61- protected decorationTypes : TextEditorDecorationType [ ] | undefined ;
61+ protected additionalDecorations : { decoration : TextEditorDecorationType , ranges : Range [ ] } [ ] | undefined ;
6262
6363 async clear ( ) {
64- if ( this . editor === undefined || this . decorationTypes === undefined || this . decorationTypes . length === 0 ) return ;
64+ if ( this . editor === undefined || this . additionalDecorations === undefined || this . additionalDecorations . length === 0 ) return ;
6565
6666 if ( this . decoration !== undefined ) {
6767 try {
@@ -70,15 +70,15 @@ export abstract class AnnotationProviderBase extends Disposable {
7070 catch { }
7171 }
7272
73- if ( this . decorationTypes !== undefined && this . decorationTypes . length > 0 ) {
74- for ( const dt of this . decorationTypes ) {
73+ if ( this . additionalDecorations !== undefined && this . additionalDecorations . length > 0 ) {
74+ for ( const d of this . additionalDecorations ) {
7575 try {
76- this . editor . setDecorations ( dt , [ ] ) ;
76+ this . editor . setDecorations ( d . decoration , [ ] ) ;
7777 }
7878 catch { }
7979 }
8080
81- this . decorationTypes = undefined ;
81+ this . additionalDecorations = undefined ;
8282 }
8383
8484 if ( this . highlightDecoration !== undefined ) {
@@ -121,6 +121,12 @@ export abstract class AnnotationProviderBase extends Disposable {
121121
122122 if ( this . decorations !== undefined && this . decorations . length ) {
123123 this . editor . setDecorations ( this . decoration ! , this . decorations ) ;
124+
125+ if ( this . additionalDecorations !== undefined && this . additionalDecorations . length ) {
126+ for ( const d of this . additionalDecorations ) {
127+ this . editor . setDecorations ( d . decoration , d . ranges ) ;
128+ }
129+ }
124130 }
125131 }
126132
0 commit comments