Skip to content

Commit 7f7cd90

Browse files
committed
Replaced setStatusBarMessage with sbar usage.
1 parent fdfd978 commit 7f7cd90

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/fileSync.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class FileSync {
2929
context.subscriptions.push(this.channel);
3030

3131
//Set up status bar
32-
this.sbar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 1);
32+
this.sbar = vscode.window.createStatusBarItem();
3333
this.sbar.text = "$(file-symlink-file)";
3434
this.sbar.tooltip = "File Sync is Active";
3535
context.subscriptions.push(this.sbar);
@@ -109,17 +109,11 @@ export class FileSync {
109109

110110
this.log(`Attempting ${file.fileName} -> ${dest.fsPath}`);
111111
vscode.workspace.fs.copy(file.uri, dest, {overwrite: true})
112-
.then(val => {
113-
/*
114-
this.sbar.color = "statusBarItem.prominentForeground";
115-
this.sbar.text = `$(sync) ${file.fileName} has been synced -> ${dest.fsPath}`;
116-
this.sbar.show();
117-
setTimeout(() => {this.sbar.hide();} , 5*1000);
118-
*/
112+
.then(() => {
119113
this.log("Success");
120-
vscode.window.setStatusBarMessage(`${file.fileName} synced to ${dest.fsPath}`, 5*1000);
114+
this.sbar.text = this.sbar.text + ` ${file.fileName} synced to ${dest.fsPath}`;
115+
setTimeout(() => { this.sbar.text = "$(file-symlink-file)";}, 5*1000);
121116
}, err => { this.log("Error:\t"+err.message); vscode.window.showErrorMessage("Error:\t"+err.message); });
122-
//}, (...args) => { console.log(args); });
123117
} else if(Array.isArray(map.destination)){
124118
//Multi Destination
125119
for (let dest of map.destination){

0 commit comments

Comments
 (0)