Skip to content

Commit ec615ec

Browse files
committed
Adds getAltKeySymbol to platform
1 parent c9bdfc2 commit ec615ec

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/env/browser/platform.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@ export function getPlatform(): Platform {
1919
export function getTempFile(filename: string): string {
2020
return filename;
2121
}
22+
23+
export function getAltKeySymbol(): string {
24+
if (isMac) return '⌥';
25+
return 'Alt';
26+
}

src/env/node/platform.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@ export function getPlatform(): Platform {
2222
export function getTempFile(filename: string): string {
2323
return join(tmpdir(), filename);
2424
}
25+
26+
export function getAltKeySymbol(): string {
27+
if (isMac) return '⌥';
28+
return 'Alt';
29+
}

src/webviews/apps/commitDetails/components/gl-inspect-nav.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { css, html, LitElement } from 'lit';
22
import { customElement, property } from 'lit/decorators.js';
33
import { when } from 'lit/directives/when.js';
4+
import { getAltKeySymbol } from '@env/platform';
45
import type { State } from '../../../commitDetails/protocol';
56
import { commitActionStyles } from './commit-action.css';
67

@@ -143,7 +144,8 @@ export class GlInspectNav extends LitElement {
143144
>
144145
</a>
145146
<span slot="content"
146-
>Copy ${this.stashNumber != null ? 'Stash Name' : 'SHA'}<br />[⌥] Copy Message</span
147+
>Copy ${this.stashNumber != null ? 'Stash Name' : 'SHA'}<br />[${getAltKeySymbol()}]
148+
Copy Message</span
147149
>
148150
</gl-tooltip>
149151
`,

0 commit comments

Comments
 (0)