From 914fab61c4a23b2c4a84894d00f8e5c1601a9a7e Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 29 Jan 2021 01:32:37 -0500 Subject: [PATCH] Closes #1353 - improves status bar flicker Also makes it the default --- CHANGELOG.md | 1 + package.json | 2 +- src/annotations/lineAnnotationController.ts | 1 + src/git/formatters/commitFormatter.ts | 3 ++- src/statusbar/statusBarController.ts | 3 +++ 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4359ae..021d779 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Changed +- Changes `gitlens.statusBar.reduceFlicker` to be on by default and improves it's display — closes [#1353](https://github.com/eamodio/vscode-gitlens/issues/1353) - Changes the _Interactive Rebase Editor_ to abort the rebase if you just close it without choosing an action - Changes _Push to Commit..._ on the HEAD commit to be _Push_ instead as there is no need for a commit specific push in that case - Renames _Browse from Here_ command to _Browse Repository from Here_ in the command palette and quick pick menus diff --git a/package.json b/package.json index 4941f2f..8d27510 100644 --- a/package.json +++ b/package.json @@ -1653,7 +1653,7 @@ }, "gitlens.statusBar.reduceFlicker": { "type": "boolean", - "default": false, + "default": true, "markdownDescription": "Specifies whether to avoid clearing the previous blame information when changing lines to reduce status bar \"flashing\"", "scope": "window" }, diff --git a/src/annotations/lineAnnotationController.ts b/src/annotations/lineAnnotationController.ts index a606c96..85a679b 100644 --- a/src/annotations/lineAnnotationController.ts +++ b/src/annotations/lineAnnotationController.ts @@ -296,6 +296,7 @@ export class LineAnnotationController implements Disposable { dateFormat: cfg.dateFormat === null ? Container.config.defaultDateFormat : cfg.dateFormat, getBranchAndTagTips: getBranchAndTagTips, pullRequestOrRemote: prs?.get(commit.ref), + pullRequestPendingMessage: `PR ${GlyphChars.Ellipsis}`, }, cfg.scrollable, ) as DecorationOptions; diff --git a/src/git/formatters/commitFormatter.ts b/src/git/formatters/commitFormatter.ts index 7921d64..95079c4 100644 --- a/src/git/formatters/commitFormatter.ts +++ b/src/git/formatters/commitFormatter.ts @@ -44,6 +44,7 @@ export interface CommitFormatOptions extends FormatOptions { messageIndent?: number; messageTruncateAtNewLine?: boolean; pullRequestOrRemote?: PullRequest | Promises.CancellationError | GitRemote; + pullRequestPendingMessage?: string; presence?: ContactPresence; previousLineDiffUris?: { current: GitUri; previous: GitUri | undefined }; remotes?: GitRemote[]; @@ -507,7 +508,7 @@ export class CommitFormatter extends Formatter { } else if (pr instanceof Promises.CancellationError) { text = this._options.markdown ? `[PR $(sync~spin)](command:${Commands.RefreshHover} "Searching for a Pull Request (if any) that introduced this commit...")` - : `PR ${GlyphChars.Ellipsis}`; + : this._options?.pullRequestPendingMessage ?? emptyStr; } else { return this._padOrTruncate(emptyStr, this._options.tokenOptions.pullRequest); } diff --git a/src/statusbar/statusBarController.ts b/src/statusbar/statusBarController.ts index 05924ef..9ea8256 100644 --- a/src/statusbar/statusBarController.ts +++ b/src/statusbar/statusBarController.ts @@ -131,6 +131,8 @@ export class StatusBarController implements Disposable { if (clear) { this.clearBlame(); + } else if (this._statusBarBlame != null) { + this._statusBarBlame.text = this._statusBarBlame.text.replace('$(git-commit)', '$(sync~spin)'); } } @@ -177,6 +179,7 @@ export class StatusBarController implements Disposable { getBranchAndTagTips: getBranchAndTagTips, messageTruncateAtNewLine: true, pullRequestOrRemote: pr, + pullRequestPendingMessage: 'PR $(sync~spin)', })}`; switch (cfg.command) {