Parcourir la source

Adds an arrow to the open changes action on hovers

Makes commit ids code-blocks in hovers to stand out more
Updates the tooltip for clarity as well
main
Eric Amodio il y a 3 ans
Parent
révision
4adbf0e51f
2 fichiers modifiés avec 6 ajouts et 6 suppressions
  1. +5
    -5
      src/git/formatters/commitFormatter.ts
  2. +1
    -1
      src/views/nodes/commitNode.ts

+ 5
- 5
src/git/formatters/commitFormatter.ts Voir le fichier

@ -289,7 +289,7 @@ export class CommitFormatter extends Formatter {
this._options.tokenOptions.commands,
)}\``;
commands += `  **[\`${GlyphChars.MuchLessThan}\`](${DiffWithCommand.getMarkdownCommandArgs({
commands += `  [$(chevron-left)$(compare-changes)](${DiffWithCommand.getMarkdownCommandArgs({
lhs: {
sha: diffUris.previous.sha ?? emptyStr,
uri: diffUris.previous.documentUri(),
@ -300,7 +300,7 @@ export class CommitFormatter extends Formatter {
},
repoPath: this._item.repoPath,
line: this._options.editor?.line,
})} "Open Changes")** `;
})} "Open Changes with Previous Revision")`;
} else {
commands = `\`${this._padOrTruncate(
GitRevision.shorten(
@ -315,14 +315,14 @@ export class CommitFormatter extends Formatter {
const separator = '   |   ';
commands = `---\n\n[$(git-commit) ${this.id}](${ShowQuickCommitCommand.getMarkdownCommandArgs(
commands = `---\n\n[\`$(git-commit) ${this.id}\`](${ShowQuickCommitCommand.getMarkdownCommandArgs(
this._item.sha,
)} "Show Commit")`;
commands += `   [$(compare-changes)](${DiffWithCommand.getMarkdownCommandArgs(
commands += `  [$(chevron-left)$(compare-changes)](${DiffWithCommand.getMarkdownCommandArgs(
this._item,
this._options.editor?.line,
)} "Open Changes")`;
)} "Open Changes with Previous Revision")`;
if (this._item.previousSha != null) {
const uri = GitUri.toRevisionUri(

+ 1
- 1
src/views/nodes/commitNode.ts Voir le fichier

@ -151,7 +151,7 @@ export class CommitNode extends ViewRefNode
}
const tooltip = await CommitFormatter.fromTemplateAsync(
`\${'$(git-commit) 'id }\${' via 'pullRequest}\${ \u2022 changesDetail}\${'   'tips}\n\n\${avatar}  __\${author}__, \${ago}   _(\${date})_ \n\n\${message}\${\n\n---\n\nfootnotes}`,
`\${'\`$(git-commit) 'id\`}\${' via 'pullRequest}\${'  \u2022  'changesDetail}\${';    'tips}\n\n\${avatar}  __\${author}__, \${ago}   _(\${date})_ \n\n\${message}\${\n\n---\n\nfootnotes}`,
this.commit,
{
autolinkedIssuesOrPullRequests: autolinkedIssuesOrPullRequests,

Chargement…
Annuler
Enregistrer