mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-16 01:25:42 -05:00
Adds new recent changes annotations
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
'use strict';
|
||||
import { Functions, Objects } from './system';
|
||||
import { DecorationOptions, DecorationRenderOptions, Disposable, ExtensionContext, Range, StatusBarAlignment, StatusBarItem, TextEditor, TextEditorDecorationType, TextEditorSelectionChangeEvent, window, workspace } from 'vscode';
|
||||
import { AnnotationController } from './annotations/annotationController';
|
||||
import { AnnotationController, FileAnnotationType } from './annotations/annotationController';
|
||||
import { Annotations, endOfLineIndex } from './annotations/annotations';
|
||||
import { Commands } from './commands';
|
||||
import { TextEditorComparer } from './comparers';
|
||||
import { FileAnnotationType, IConfig, LineAnnotationType, StatusBarCommand } from './configuration';
|
||||
import { IConfig, StatusBarCommand } from './configuration';
|
||||
import { DocumentSchemes, ExtensionKey } from './constants';
|
||||
import { BlameabilityChangeEvent, CommitFormatter, GitCommit, GitCommitLine, GitContextTracker, GitService, GitUri } from './gitService';
|
||||
|
||||
@@ -16,6 +16,12 @@ const annotationDecoration: TextEditorDecorationType = window.createTextEditorDe
|
||||
}
|
||||
} as DecorationRenderOptions);
|
||||
|
||||
export type LineAnnotationType = 'trailing' | 'hover';
|
||||
export const LineAnnotationType = {
|
||||
Trailing: 'trailing' as LineAnnotationType,
|
||||
Hover: 'hover' as LineAnnotationType
|
||||
};
|
||||
|
||||
export class CurrentLineController extends Disposable {
|
||||
|
||||
private _activeEditorLineDisposable: Disposable | undefined;
|
||||
@@ -351,6 +357,20 @@ export class CurrentLineController extends Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case FileAnnotationType.RecentChanges: {
|
||||
const cfgChanges = this._config.annotations.file.recentChanges.hover;
|
||||
if (cfgChanges.changes) {
|
||||
if (cfgChanges.wholeLine) {
|
||||
// Avoid double annotations if we are showing the whole-file hover blame annotations
|
||||
showChanges = false;
|
||||
}
|
||||
else {
|
||||
showChangesInStartingWhitespace = false;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user