浏览代码

Keeps the hover info in the whitespace area at the start of the current line

main
Eric Amodio 7 年前
父节点
当前提交
0bd31099ce
共有 2 个文件被更改,包括 12 次插入6 次删除
  1. +4
    -4
      src/annotations/gutterBlameAnnotationProvider.ts
  2. +8
    -2
      src/annotations/hoverBlameAnnotationProvider.ts

+ 4
- 4
src/annotations/gutterBlameAnnotationProvider.ts 查看文件

@ -62,8 +62,8 @@ export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
compacted = true;
}
// const firstNonWhitespace = document.lineAt(line).firstNonWhitespaceCharacterIndex;
gutter.range = new Range(line, 0, line, 0); // document.validateRange(new Range(line, 0, line, firstNonWhitespace));
const endIndex = document.lineAt(line).firstNonWhitespaceCharacterIndex;
gutter.range = new Range(line, 0, line, endIndex);
decorations.push(gutter);
if (details !== undefined) {
@ -93,8 +93,8 @@ export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
Annotations.applyHeatmap(gutter, commit.date, now);
}
// const firstNonWhitespace = document.lineAt(line).firstNonWhitespaceCharacterIndex;
gutter.range = new Range(line, 0, line, 0); // document.validateRange(new Range(line, 0, line, firstNonWhitespace));
const endIndex = document.lineAt(line).firstNonWhitespaceCharacterIndex;
gutter.range = new Range(line, 0, line, endIndex);
decorations.push(gutter);
if (cfg.hover.details) {

+ 8
- 2
src/annotations/hoverBlameAnnotationProvider.ts 查看文件

@ -24,6 +24,7 @@ export class HoverBlameAnnotationProvider extends BlameAnnotationProviderBase {
const dateFormat = this._config.defaultDateFormat;
const decorations: DecorationOptions[] = [];
const document = this.document;
let commit: GitBlameCommit | undefined;
let hover: DecorationOptions | undefined;
@ -36,8 +37,13 @@ export class HoverBlameAnnotationProvider extends BlameAnnotationProviderBase {
hover = Annotations.hover(commit, renderOptions, cfg.heatmap.enabled, dateFormat);
const endIndex = cfg.wholeLine ? endOfLineIndex : this.editor.document.lineAt(line).firstNonWhitespaceCharacterIndex;
hover.range = this.editor.document.validateRange(new Range(line, 0, line, endIndex));
if (cfg.wholeLine) {
hover.range = document.validateRange(new Range(line, 0, line, endOfLineIndex));
}
else {
const endIndex = document.lineAt(line).firstNonWhitespaceCharacterIndex;
hover.range = new Range(line, 0, line, endIndex);
}
if (cfg.heatmap.enabled) {
Annotations.applyHeatmap(hover, commit.date, now);

正在加载...
取消
保存