mirror of
https://github.com/hexedtech/codemp-vscode.git
synced 2024-11-22 07:24:49 +01:00
feat: show current file as description, not label
This commit is contained in:
parent
3e9a6999ab
commit
117a540d6f
2 changed files with 7 additions and 7 deletions
|
@ -418,8 +418,7 @@ export async function jump(selected: vscode.TreeItem | undefined){
|
||||||
user = selected.label.label;
|
user = selected.label.label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(user) user = user.split(' (')[0];//Label on tree also contains Buffer name along with username
|
if (!user) user = await vscode.window.showInputBox({ prompt: "username"});
|
||||||
else user = await vscode.window.showInputBox({ prompt: "username"});
|
|
||||||
if (!user) return; // user cancelled with ESC
|
if (!user) return; // user cancelled with ESC
|
||||||
|
|
||||||
let user_hl = mapping.colors_cache.get(user);
|
let user_hl = mapping.colors_cache.get(user);
|
||||||
|
|
11
src/tree.ts
11
src/tree.ts
|
@ -63,14 +63,15 @@ export class CodempTreeProvider implements vscode.TreeDataProvider<CodempTreeIte
|
||||||
|
|
||||||
class CodempTreeItem extends vscode.TreeItem {
|
class CodempTreeItem extends vscode.TreeItem {
|
||||||
type: Type;
|
type: Type;
|
||||||
constructor(label: string | vscode.TreeItemLabel, type: Type, expandable: boolean, active?: boolean){
|
constructor(label: string | vscode.TreeItemLabel, type: Type, opts: { description?: string, expandable?: boolean, active?: boolean }){
|
||||||
let state = expandable ? vscode.TreeItemCollapsibleState.Expanded : vscode.TreeItemCollapsibleState.None;
|
let state = opts.expandable ? vscode.TreeItemCollapsibleState.Expanded : vscode.TreeItemCollapsibleState.None;
|
||||||
super(label, state);
|
super(label, state);
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.contextValue = type;
|
this.contextValue = type;
|
||||||
if (active) this.contextValue += "_active";
|
this.description = opts.description || "";
|
||||||
if (type === Type.Workspace) this.iconPath = new vscode.ThemeIcon(active ? "timeline-pin" : "extensions-remote");
|
if (opts.active) this.contextValue += "_active";
|
||||||
else if (type === Type.Buffer) this.iconPath = new vscode.ThemeIcon(active ? "debug-restart-frame" : "debug-console-clear-all");
|
if (type === Type.Workspace) this.iconPath = new vscode.ThemeIcon(opts.active ? "timeline-pin" : "extensions-remote");
|
||||||
|
else if (type === Type.Buffer) this.iconPath = new vscode.ThemeIcon(opts.active ? "debug-restart-frame" : "debug-console-clear-all");
|
||||||
else if (type === Type.UserList ) this.iconPath = new vscode.ThemeIcon("accounts-view-bar-icon");
|
else if (type === Type.UserList ) this.iconPath = new vscode.ThemeIcon("accounts-view-bar-icon");
|
||||||
else if (type === Type.User ) this.iconPath = new vscode.ThemeIcon("debug-breakpoint-data-unverified");
|
else if (type === Type.User ) this.iconPath = new vscode.ThemeIcon("debug-breakpoint-data-unverified");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue