mirror of
https://github.com/hexedtech/codemp-vscode.git
synced 2024-12-23 05:54:51 +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;
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
|
11
src/tree.ts
11
src/tree.ts
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue