diff options
Diffstat (limited to 'editors/code/src/commands/watch_status.ts')
-rw-r--r-- | editors/code/src/commands/watch_status.ts | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/editors/code/src/commands/watch_status.ts b/editors/code/src/commands/watch_status.ts index 0943e8533..1b0611ce3 100644 --- a/editors/code/src/commands/watch_status.ts +++ b/editors/code/src/commands/watch_status.ts | |||
@@ -9,15 +9,20 @@ export class StatusDisplay { | |||
9 | private timer?: NodeJS.Timeout; | 9 | private timer?: NodeJS.Timeout; |
10 | 10 | ||
11 | constructor(subscriptions: vscode.Disposable[]) { | 11 | constructor(subscriptions: vscode.Disposable[]) { |
12 | this.statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 10); | 12 | this.statusBarItem = vscode.window.createStatusBarItem( |
13 | vscode.StatusBarAlignment.Left, | ||
14 | 10 | ||
15 | ); | ||
13 | subscriptions.push(this.statusBarItem); | 16 | subscriptions.push(this.statusBarItem); |
14 | this.statusBarItem.hide(); | 17 | this.statusBarItem.hide(); |
15 | } | 18 | } |
16 | 19 | ||
17 | public show() { | 20 | public show() { |
18 | this.timer = this.timer || setInterval(() => { | 21 | this.timer = |
19 | this.statusBarItem!.text = 'cargo check ' + this.frame(); | 22 | this.timer || |
20 | }, 300); | 23 | setInterval(() => { |
24 | this.statusBarItem!.text = 'cargo check ' + this.frame(); | ||
25 | }, 300); | ||
21 | 26 | ||
22 | this.statusBarItem!.show(); | 27 | this.statusBarItem!.show(); |
23 | } | 28 | } |
@@ -32,6 +37,6 @@ export class StatusDisplay { | |||
32 | } | 37 | } |
33 | 38 | ||
34 | private frame() { | 39 | private frame() { |
35 | return spinnerFrames[this.i = ++this.i % spinnerFrames.length]; | 40 | return spinnerFrames[(this.i = ++this.i % spinnerFrames.length)]; |
36 | } | 41 | } |
37 | } \ No newline at end of file | 42 | } |