feat: show current file as description, not label

This commit is contained in:
əlemi 2024-09-25 05:08:55 +02:00
parent 3e9a6999ab
commit 117a540d6f
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 7 additions and 7 deletions

View file

@ -418,8 +418,7 @@ export async function jump(selected: vscode.TreeItem | undefined){
user = selected.label.label;
}
}
if(user) user = user.split(' (')[0];//Label on tree also contains Buffer name along with username
else user = await vscode.window.showInputBox({ prompt: "username"});
if (!user) user = await vscode.window.showInputBox({ prompt: "username"});
if (!user) return; // user cancelled with ESC
let user_hl = mapping.colors_cache.get(user);

View file

@ -63,14 +63,15 @@ export class CodempTreeProvider implements vscode.TreeDataProvider<CodempTreeIte
class CodempTreeItem extends vscode.TreeItem {
type: Type;
constructor(label: string | vscode.TreeItemLabel, type: Type, expandable: boolean, active?: boolean){
let state = expandable ? vscode.TreeItemCollapsibleState.Expanded : vscode.TreeItemCollapsibleState.None;
constructor(label: string | vscode.TreeItemLabel, type: Type, opts: { description?: string, expandable?: boolean, active?: boolean }){
let state = opts.expandable ? vscode.TreeItemCollapsibleState.Expanded : vscode.TreeItemCollapsibleState.None;
super(label, state);
this.type = type;
this.contextValue = type;
if (active) this.contextValue += "_active";
if (type === Type.Workspace) this.iconPath = new vscode.ThemeIcon(active ? "timeline-pin" : "extensions-remote");
else if (type === Type.Buffer) this.iconPath = new vscode.ThemeIcon(active ? "debug-restart-frame" : "debug-console-clear-all");
this.description = opts.description || "";
if (opts.active) this.contextValue += "_active";
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.User ) this.iconPath = new vscode.ThemeIcon("debug-breakpoint-data-unverified");
}